#include <stdio.h>
#include <conio.h>
void main()
{
int n,r,reverse=0,a;
clrscr();
printf("Enter any Number: ");
scanf("%d",&n);
a=n;
while(n)
{
r=n%10;
reverse=reverse*10+r;
n=n/10;
}
if(a==reverse)
printf("%d is palindrome",a);
else
printf("%d is not palindrome",a);
getch();
}
#include <conio.h>
void main()
{
int n,r,reverse=0,a;
clrscr();
printf("Enter any Number: ");
scanf("%d",&n);
a=n;
while(n)
{
r=n%10;
reverse=reverse*10+r;
n=n/10;
}
if(a==reverse)
printf("%d is palindrome",a);
else
printf("%d is not palindrome",a);
getch();
}
No comments:
Post a Comment