/* www.programming9.com */
#include<stdio.h>
main()
{
int no, digit = 0, temp;
printf("Enter an Integer to check for Palindrome : ");
scanf("%d",&no);
temp = no;
while( temp != 0 )
{
digit = digit * 10;
digit = digit + temp%10;
temp = temp/10;
}
if ( no == digit )
printf("\n %d is a Palindrome Number :)\n", no);
else
printf("\n %d is Not a Palindrome Number :(", no);
}
OUTPUT:
Enter an Integer to check for Palindrome : 11211 11211 is a Palindrome Number :)
NOTE: A Palindrome number is a number that looks same from both directions such as Left to right or right to left. EX: 121, 11211, 12321, 14541, etc.,