#include<stdio.h>
#include<conio.h>
main()
{
int n,temp=0,t,rev=0;
clrscr();
printf("Enter the number\n");
scanf("%d",&n);
temp=n;
while(n!=0)
{
t=n%10;
rev=rev*10+t;
n=n/10;
}
if(temp==rev)
printf("Its a palindrome");
else
printf("Its not a palindrome");
getch();
return 0;
}
#include<conio.h>
main()
{
int n,temp=0,t,rev=0;
clrscr();
printf("Enter the number\n");
scanf("%d",&n);
temp=n;
while(n!=0)
{
t=n%10;
rev=rev*10+t;
n=n/10;
}
if(temp==rev)
printf("Its a palindrome");
else
printf("Its not a palindrome");
getch();
return 0;
}
very informative
ReplyDeleteThis comment has been removed by the author.
ReplyDelete