Program to check weather the number is palindrome number or not?
#include<stdio.h>
int main()
{
int num,a,b,rev,sum=0;
scanf("%d",&num);
b=num;
while(num>0)
{
a=num%10;
sum=sum*10+a;
num=num/10;
}
if(sum==b)
printf("yes");
else
printf("no");
return 0;
}
No comments:
Post a Comment