#include<stdio.h>
#include<conio.h>
main()
{
int num,d,a,r=0;
clrscr();
printf("\n enter the number=");
scanf("\n%d",&num);
a=num;
while(a)
{
d=a%10;
r=r*10+d;
a=a/10;
}
if(num==r)
printf("\n this is a palindrome");
else
printf("\n this is not palindrome");
getch();
}
output:- enter the number=111
this is a palindrome number
No comments:
Post a Comment