Find Out Weather The String Is Palindrome OR Not
#include<stdio.h>}
#include<conio.h>
void main()
{
clrscr();
int i,b,n,rev=0;
printf("enter the no");
scanf("%d",&n);
for(i=n;i>0;i=i/10)
b=i%10;
rev=rev*10+b;
if(rev==n)
{
printf("palindrome");
}
else
{
printf("not a palindrome");
}
getch();
Comments
Post a Comment