How To Get Factorial Of Any Number In Php

Simple Factorial Program In Php







<?php  

if(isset($_POST['submit'])){
$num = $_POST['num'];
$factorial = 1;
for ($x=$num; $x>=1; $x--)  
{  
  $factorial = $factorial * $x;  
}  
echo "Factorial of $num is $factorial";  

}
?>  

<form action="" method="POST">
<input type="text" name="num">


<input type="submit"  value="submit" name="submit">










</form>

Thank You
Team Gajabwap Web In Hindi
Previous
Next Post »
Thanks for your comment