2 Answers
#include <stdio.h>
int main()
{
int rev, digit, n, m;
printf(“Enter four digit number”);
scanf(“%d”, &n);
m = n;
while (n != 0)
{
digit = n % 10;
n = n / 10;
rev = rev * 10 + digit;
}
printf(“Reverse number is %d \n”, rev);
if (m == rev)
printf(“Number is a palindrome”);
else
printf(“Not a palindrome”);
}