PHP program to print factorial of a number
in this program i'm going to show you how to find factorial of given number
code:-
<?php
$value=5;
$sum=1;
for($i=1;$i<=$value;$i++)
{
$sum=$sum*$i;
}
echo "$value factorial is $sum";
?>
output:-
5 factorial is 120
Post a Comment
If you have any doubts, Please let me know
Thanks!