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