4 comments:

  1. $num1=$_POST["num"];
    $temp=$num1;
    $reverse=0;
    if($temp%10==0)
    echo "Reverse of $num1= 0";
    while($temp>=1)
    {
    $reverse=$reverse*10+$temp%10;
    $temp/=10;
    }
    echo "$reverse
    ";

    ReplyDelete
  2. php
    $n=$_POST['num'];
    $rev=0;
    while($n>1)
    {$digit =$n%10;
    $rev=$rev*10+$digit;
    $n=(int)$n/10;
    }
    echo "reverse is:$rev";
    ?>

    ReplyDelete
  3. $num=$_POST["n"];
    $temp=$num;
    $reverse=0;
    while($temp>=1)
    {
    $reverse=$reverse*10+$temp%10;
    $temp/=10;
    }
    echo "$reverse of the no. is: ".$reverse;

    ReplyDelete
  4. ?php
    $num1=$_POST['num'];
    $rev=0;
    while($num1>1)
    {$digit =$num1%10;
    $rev=$rev*10+$digit;
    $num1=(int)$num1/10;
    }
    echo "reverse is:$rev";
    ?>

    ReplyDelete