Write a program to check whether a given word is a palindrome or not?
# include
# include
void main()
{
char word[10];
int length=0,mid,count=0;
clrscr();
printf("\tEnter the Word :\> ");
gets(word); printf("\n\n\n"); while(word[count]!='\0')
{
length++;
count++;
}
mid = length/2;
for(count=0;count<=mid;count++)
{
if (word[count]!=word[(length-1)-count])
{
printf("\t\n\nGiven String is Not a Palindrome");
getch();
exit();
}
}
printf("\t\n\nGiven String is a Palindrome");
getch();
}