factorial in php

technical talkiess
0

 <?php 

$n = 5;

$factorial = 1;

for($i=$n;$i>=1;$i--){

$factorial =$factorial * $i;

}

echo "Factorial is :- " . $factorial;


?>

Post a Comment

0Comments

Thanks you for commenting your questions. I will see question and respond you.

Post a Comment (0)