#include<stdio.h>
#include<conio.h>
void main()
{
int num,rev=0,found=0,temp,digit;
clrscr();
printf("enter a integer\n");
scanf("%d",&num);
temp=num;
while(num>0)
{
digit=num%10;
rev=rev*10+digit;
num=num/10;
}
printf("given number is=%d\n",temp);
printf("its reverse is=%d\n",rev);
if(temp==rev)
printf("number is a palindrome\n",found);
else
printf("number is not a palindrome\n");
getch();
}
For 8051 microcontroller programming :http://assemblylanguage8051.blogspot.in/
No comments:
Post a Comment