Verifica si una palabra o
frase es palíndromo
# include
<stdio.h>
# include
<conio.h>
# include
<math.h>
# include
<string.h>
void main()
{
clrscr();
char pal[40],pal2[40];
int n,x,a=0,p=0,e=0;
char b=' ';
printf("\n
ingrese palabra :");
gets(pal);
n=strlen(pal);
for (int u=0;u<=n;u++)
{
if (pal[u]==b)
u++;
pal2[e]=pal[u];
e++;
}
for (x=n-1;x>=0;x--)
printf("\n pal :
%c",pal[x]);
x=0;
n=strlen(pal2);
for (x=n-1;x>=0;x--)
{
if (pal2[x]==pal2[a])
p++;
a++;
}
if (p==n)
printf("\n
palabra palindrome ");
else
printf ("\n palabra no palindrome
");
getche();
}