#include<stdio.h>
#include<stdlib.h>
void main()
{
int sum=0, i, a, rem=0,rev=0;
printf("Enter a number ") ; scanf (" %d", &a) ; sum=a; while(sum! =0) { rem=sum%10; rev=rev*10+rem; sum=sum/10; } if(a==rev) { printf ("%d is a palindrome number ", a) ; } else { printf(" %d is not a palindrome number ", a) ; } } |
Enter a number : 101 101 is a palindrome number