1.

WAP to check for palindrome.

Answer»

Program:

#include<stdio.h>
#include<conio.h>
void main()
{
char str[20);
char temp[20];
puts (“Enter any word”);
gets (str);
strcpy (temp, str);
strrev (str);
if (strcmp (str, temp) == 0)
{
printf (“it is a palindrome”);
}
else
{
printf (“it is not a palindrome”);
}
}



Discussion

No Comment Found