Created
November 11, 2016 19:02
-
-
Save rajvanshipradeep15/695fe98367f8f5e9f7b1e96f9cce7e52 to your computer and use it in GitHub Desktop.
palindrome number
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$num=121; | |
$p=$num; | |
echo "sum " . $sum; | |
while((int)$num!=0) | |
{ | |
$rem=$num%10; | |
$sum=$sum*10+$rem; | |
$num=$num/10; | |
} | |
if($sum==$p) | |
{ | |
echo $p ; | |
echo "is palindrome number"; | |
} | |
else | |
{ | |
echo $p; | |
echo "is not palindrome number"; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment