Tuesday, August 10, 2010

TO CHECK GIVEN NUMBER IS PALINDROME OR NOT

0 comments
#include<stdio.h>
#include<conio.h>
void main()
{
int num,sum=0,r,temp;
clrscr();
printf("Enter the number:");
scanf("%d",&num);
temp=num;
while(num)
{
r=num%10;
num=num/10;
sum=sum*10+r;
}
if(temp==sum)
printf("The given number is palindrome");
else
printf("The given number not palindrome");
getch();
}





Leave a Reply