#include<stdio.h>
#include<conio.h>
void main()
{
int num,rev=0,m;
clrscr();
printf("Enter a number to check:\n");
scanf("%d",&num);
m=num;
while(num>0)
{
rev=rev*10+num%10;
num=num/10;
}
if(m==rev)
printf("Number is palindrome");
else
printf("Number is not palindrome");
getch()
}
0 comments:
Post a Comment