Program for Palindrome number


#include<stdio.h>
#include<conio.h>
int main()
{
int n,r=0,i=0,temp;
clrscr();
printf("enter any no.");
scanf("%d",&n);
temp=n;
while(n>0)
{
r=i+n%10;
i=r*10;
n=n/10;
}
printf("\n the reverse of the number is %d",r);
if(temp==r)
{
printf("\n the number is a palindrome number");
}
else
{
printf("\n the number is not a palindrome number");
}
getch();
return 0;
}

0 comments:

Post a Comment