#include<stdio.h>
int main()
{
int n,a,f,rev=0,k;
printf("Enter any number\n");
scanf("%d",&n);
k=n;
while(n!=0)
{
a=n%10;
n=n/10;
rev=rev*10+a;
}
if(rev==k)
{
printf("Palindrome");
}
else
{
printf("Not Palindrome");
}
}
OUTPUT
Enter any number
2332
Palindrome
Comments
Post a Comment