#include<string.h>
void main()
{
char word[50];
int i,j,l,c=0;
printf("Enter a word : ");
gets(word);
l=strlen(word);
for(i=0,j=l-1;i<l/2;i++,j--)
{
if(word[i]-word[j]>0)
{
c=1;
break;
}
}
if(c==0)
{
printf("Palindrome");
}
else
{
printf("Not palindrome");
}
getch();
}
0 comments:
Post a Comment