58. WAP to tell if a number is PALINDROME.
#include<stdio.h>
void
main()
{
int temp,number,rev=0,r=0;
printf("WAP to reverse the digits
of given integer\n");
printf("Enter the number:");
scanf("%d",&number);
temp=number;
printf("Number :
%d\n",number);
for(;number;number=number/10)
{
r=number%10;
rev=rev*10+r;
}
if(temp==rev)
printf("Its a
PALINDROME\n");
else
printf("Its not a
PALINDROME\n");
}
Comments
Post a Comment