int main()
{
int a,b,c=0,d;
printf("\tEnter a number u want:"); //USER INPUT
scanf("%d",&a);
d=a;
while(a)
{
b=a%10;
a=a/10;
c=c*10+b;
}
printf("\tReverse number is :%d\n",c); //printing of reverse number
if(d==c)
printf("\t%d is a palindrome\n",d); //prints if polyndrome
else
printf("\t%d is not a palindrome\n",d); //prints if not polyndrome
}
No comments:
Post a Comment