#include <stdio.h>
void main()
{
int n,rev = 0,flag;
printf("Enter a number to reverse\n");
scanf("%d",&n);
flag=n;
while (n != 0)
{
n=n%10;
rev=rev * 10 +n;
n=n/10;
}
if(flag==n)
printf("Number is pallindrome);
else
printf("number is not pallindrome");
}
void main()
{
int n,rev = 0,flag;
printf("Enter a number to reverse\n");
scanf("%d",&n);
flag=n;
while (n != 0)
{
n=n%10;
rev=rev * 10 +n;
n=n/10;
}
if(flag==n)
printf("Number is pallindrome);
else
printf("number is not pallindrome");
}
No comments :
Post a Comment