#include<stdio.h>
int main()
{
int n,sum,digit,num;
printf("Enter a Number:\n");
scanf("%d",&n);
num=n;
do {
digit = n%10 ;
sum = (sum*10)+digit;
n=n/10;
}
while(n!=0);
{
printf("The Reverse of the given no = %d\n",sum);
}
if(num==sum)
{ printf(" and %d is a palindrome",num);
} else {
printf(" and %d is not a palindrome",num);
}
return 0;
}
Note: Need to be arranged in compiler after copied
OutPut:
Enter a Number:
1234321
The Reverse of the given no = 1234321
and 1234321 is a palindrome