Tuesday, 27 December 2011

C program to check whether a number is Palindrome or not



#include<stdio.h>
main()
{
int n,t,s,r;
printf("Enter any number\n");
scanf("%d",&n);
t=n;
s=0;
while(n>0)
{
r=n%10;
s=(s*10)+r;
n=n/10;
}
if(t==s)
printf("%d is a Palindrome number",t);
else
printf("%d is not a Palindrome number",t);
printf("\n");
}



You Like It!? Then kindly share with your Friends.
Comments
0 Comments

No comments:

Post a Comment