#include<stdio.h>
int main()
{
int a,b,c,d,x,m,rev;
printf("Enter four digit numbers\n");
scanf("%d",&x);
m=x;
a=x%10;
x=x/10;
b=x%10;
x=x/10;
c=x%10;
x=x/10;
d=x%10;
x=x/10;
rev=a*1000+b*100+c*10+d;
if(rev==m)
{
printf("Enter Number is Palindrome");
}
else
{
printf("Enter number is not Palindrome");
}
}
OUTPUT
Enter four digit numbers
1771
Enter Number is Palindrome
Comments
Post a Comment