Quote:
Originally Posted by ankit_golden
how to check if any given number is a palindrome or not...
the number is entered from the user
|
void main()
{
int n,d,sum=0,ori;
printf("\nEnter any No. :");
scanf("%d",&n);
ori=n;
while(n>=1)
{
d=n%10;
n=n/10;
sum=sum*10+d;
}
if(sum==ori)
printf("\n given number is a palindrome.");
else
printf("\ngiven number is a not palindrome.");
getch();
}