php factorial
function Factorial($n) {
return ($n <= 1) ? 1 : $n * Factorial($n - 1);
}
php factorial
function Factorial($n) {
return ($n <= 1) ? 1 : $n * Factorial($n - 1);
}
php program to find factorial of a number using function
function Factorial($number){
if($number <= 1){
return 1;
}
else{
return $number * Factorial($number - 1);
}
}
$number = 5;
$fact = Factorial($number);
echo "Factorial = $fact"; //output : 120
?>
php program to find factorial of a number using function
<?php
function Factorial($number){
if($number <= 1){
return 1;
}
else{
return $number * Factorial($number - 1);
}
}
$number = 5;
$fact = Factorial($number);
echo "Factorial = $fact"; //output : 120
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us