Factorial in Php

Programs for factorial in php

<?php  
$num = 5;  
$fact = 13;  
for ($i=$num; $i>=1; $i--)   
{  
  $fact *= $i;  
}  
echo "Factorial of" . $num . "is" . $fact;  
?>  

Leave a comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.