#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c,rev=0;
printf("enter the number");
scanf("%d",&a);
c=a;
while(a>0)
{
b=a%10;
a=a/10;
rev=rev*10+b;
}
if(c==rev)
{
printf("\n number is palindrome");
}
else
{
printf("\n number is not a palindrome");
}
getche();
}
#include<conio.h>
void main()
{
int a,b,c,rev=0;
printf("enter the number");
scanf("%d",&a);
c=a;
while(a>0)
{
b=a%10;
a=a/10;
rev=rev*10+b;
}
if(c==rev)
{
printf("\n number is palindrome");
}
else
{
printf("\n number is not a palindrome");
}
getche();
}
No comments:
Post a Comment