3 comments:

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

    ReplyDelete
  2. php
    $n=$_POST['num'];
    $rev=0;
    $temp=$n;
    while($n>1)
    {$digit =$n%10;
    $rev=$rev*10+$digit;
    $n=(int)$n/10;
    }
    if($temp==$rev)
    echo "it is an pallindrome number";
    else
    echo"it is not a pallindrome number";
    ?>

    ReplyDelete
  3. $num=$_POST["n"];
    $reverse=0;
    $temp=$num;
    while($temp>=1)
    {
    $reverse=$reverse*10+$temp%10;
    $temp/=10;
    }
    if($reverse==$num)
    echo "The number is Palindrome";
    else
    echo "The number is not palindrome";

    ReplyDelete