quick links

Find factorial number

Factorial of a non-negative integer, is multiplication of all integers smaller than or equal to n. For example factorial of 5 is 5*4*3*2*1 which is 120.

Factorial of number 5

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

OUTPUT: Factorial of 5 is 120

 

About Us

Joomla Web Solution

We love working with PHP, HTML5, CSS3, jQuery and the most-loved content management framework in the world, Joomla!

LIKE US ON FACEBOOK