4 comments:

  1. $num=$_POST["limit"];
    for($i=1;$i<=$num;$i++)
    {
    $factorial=1;
    for($j=1;$j<=$i;$j++)
    {
    $factorial*=$j;
    }
    echo "$i! $factorial
    ";

    ReplyDelete
  2. php
    $num1=$_POST['num'];
    $f=1;
    for($i=1;$i<=$num1;$i++)
    { $f=$f*$i;
    echo"
    $i! =$f";
    }
    ?>

    ReplyDelete
  3. $N=$_POST['n'];
    echo "The no. who's factorial is to be calculated is: ".$N;
    echo "
    ";
    $factorial=1;
    for($i=$N;$i>0;$i--)
    {
    $factorial=$factorial*$i;
    }
    echo "The factorial is: ".$factorial;
    echo "
    ";

    ReplyDelete
  4. php
    $num=$_POST["no"];
    $f=1;
    for($i=1;$i<=$num;$i++)
    { $f=$f*$i;
    echo"$i!:"."$f";
    }
    ?>

    ReplyDelete