Wednesday, October 27, 2010

Palindrome-c

void main() 
{
int n,sum=0,a,r;
printf("enter a num"); scanf("%d",&n);
a=n;
while(n>0)
{
r=n%10;
sum=sum*10+r;
n=n/10;
}
if(a==n)
printf("the num is palindrome");
else
printf("the num is not palindrome");
getch();
}

No comments:

Post a Comment