php program to find factorial of a number using function

Solutions on MaxInterview for php program to find factorial of a number using function by the best coders in the world

showing results for - "php program to find factorial of a number using function"
Niko
10 Jul 2019
1function Factorial($n) {
2  	return ($n <= 1) ? 1 : $n * Factorial($n - 1);
3}
Martina
26 Apr 2019
1function Factorial($number){ 
2    if($number <= 1){   
3        return 1;   
4    }   
5    else{   
6        return $number * Factorial($number - 1);   
7    }   
8} 
9  
10$number = 5; 
11$fact = Factorial($number); 
12echo "Factorial = $fact";  //output : 120
13?> 
Lukas
29 Feb 2018
1<?php
2function Factorial($number){ 
3    if($number <= 1){   
4        return 1;   
5    }   
6    else{   
7        return $number * Factorial($number - 1);   
8    }   
9} 
10  
11$number = 5; 
12$fact = Factorial($number); 
13echo "Factorial = $fact";  //output : 120
14?> 
queries leading to this page
factorial in php using for loopfactorial of 5 in phpprogram to find the factorial of a number using function phpwhat is factorial number in phpfactorial de 5 phpcreating factorial in php and return in htmlwrite a php program to accept a number from the user and print it factorialphp factor 5cwrite a php program to print factorial of any numberhow to write a function in php to get the factorial of a given numbercreating a two factor in phphow to find factorial of a number in phpfactorial php functionwrite a function to calculate the factorial of a number the function number as an argument phpfactoriel en phpphp program to find factorial of a number using functionphp program to find factorial of a numbertake a number as parameter and returns its factorial in phpwrite a program to find the factorial of a number in phptake a number as parameter and returns its factorial in php using functionsphp factorial programfactorial program phpphp factorial loopphp factorial functionwrite a function to calculate the factorial of a number in phpfactor quadratic phpfactoral phpphp code for factorial of a numberfactorial using for loop in phpfactorial function phpcalc factorial phpcreating factorial in phpfactorial by phpphp code to find factorial of a numberwrite a function to calculate factorial of given number phpfactorial of number in phpfactorial example in phpphp factorialphp factorial numberfactorial phpfactorial of a number in phpwrite a program to calculate and print the factorial of a number in phpphp calculate factorialfactorial number phpphp script to find factorial of a given numbercalcular factoriales phpwrite a php program to calculate factorial of a number the user should give the input php factoriellefactorial program in phpwrite php script to find factorial of a function using functionsfactorial in phpfactorial of n number in phpfactorial og a number phpfactorial program loop in phpfactoria phpfind factorial of a number phpfactorial program in php using for loopfind factorial using while in phpfactor trinomial phpphp code to calculate factorial of given numberfactorial of a number in php using classesfactorial in table in php if equal to factorial of number phpphp factoral method examplehow to get factorial table in phpwrite a program to calculate and print the factorial of a number in php using ajaxhow to find a factorial in phpfactorail of a number in php using user inputfactorial using function in phpwrite a program to find devisor or factorial of a program phphow to fiund a factorial of a number in phgpphp to find factorial of a numberfactorial of number in pgpfactorial numero phpfactorial of a number in php using functionfactorial en phpphp program for factorial of a numberwap to factorial of a number in phpwrite a php program to find factorial of a number find factorial of a number in phpfactor phpfactorial method phphow to find factorial of a number php using while2 factor phpfirst factorial phpcalculating factorials phpfactorial number in phpphp program to find factorial of a number using function