php factorial

Solutions on MaxInterview for php factorial by the best coders in the world

showing results for - "php factorial"
Sofia
23 Feb 2017
1function Factorial($n) {
2  	return ($n <= 1) ? 1 : $n * Factorial($n - 1);
3}
Manuela
31 Nov 2016
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?> 
Erik
28 Oct 2016
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
write a function to calculate factorial of given number phpphp factorialphp factorial numberphp calculate factorialwrite a php program to print factorial of any numberhow to fiund a factorial of a number in phgpwrite a function to calculate the factorial of a number the function number as an argument phpcreating a two factor in phpfactorial by phpphp code to find factorial of a numberfactor phpfactorial using function in phphow to find factorial of a number in phpwrite a php program to accept a number from the user and print it factorialwrite a function to calculate the factorial of a number in phpfactorial of a number in phpfactorial program in phpfind factorial of a number in phpfactorial of a number in php using functionwhat is factorial number in phpphp code to calculate factorial of given numberif equal to factorial of number phpprogram to find the factorial of a number using function phpfind factorial of a number phpfactorial using for loop in phpfactorial in table in php php program for factorial of a numberfactorial number in phpphp to find factorial of a numberfactorail of a number in php using user inputhow to get factorial table in phpwrite a program to find devisor or factorial of a program phpfactoral phpphp program to find factorial of a numberfactorial example in phphow to find a factorial in phpfactorial of 5 in phpphp factorial programhow to write a function in php to get the factorial of a given numberfactor quadratic phpwrite php script to find factorial of a function using functionswrite a program to calculate and print the factorial of a number in phpfactorial number phpfactorial program loop in phpfactorial numero phpcreating factorial in php and return in htmlfactorial program phpfactorial en phpfactorial phpwrite a program to find the factorial of a number in phpfactorial of number in pgpphp code for factorial of a numberfactorial php functionfactoriel en phpfactorial program in php using for loopphp factorial functionfactoria phpfactorial of a number in php using classestake a number as parameter and returns its factorial in php using functionscalculating factorials phphow to find factorial of a number php using whilefactorial function phpcreating factorial in phpwrite a php program to calculate factorial of a number the user should give the input factor trinomial phpfirst factorial phpphp factorial loopfactorial method phpphp program to find factorial of a number using functionphp factoral method examplefactorial de 5 phpfactorial og a number phpwrite a program to calculate and print the factorial of a number in php using ajaxcalc factorial phpfactorial in phpfind factorial using while in phpwrite a php program to find factorial of a number php factor 5cphp script to find factorial of a given numberfactorial in php using for loopphp factorielle2 factor phptake a number as parameter and returns its factorial in phpfactorial of n number in phpwap to factorial of a number in phpfactorial of number in phpcalcular factoriales phpphp factorial