Thursday, July 28, 2011

Palindrome Number

#include<stdio.h>
void main()

{
int n,dup,rem,rev=0;
clrscr();
printf("Enter an integer number : ");
scanf("%d",&n);
dup=n;
for(;n>0;n/=10)
{
rem=n%10;
rev=rev*10+rem;
}
if(rev==dup)
printf("\nIt is a palindrome number");
else
printf("\nIt is not a palindrome number");
getch();
}

No comments:

Post a Comment