/****************************************************************************** Welcome to GDB Online. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl, C#, OCaml, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog. Code, Compile, Run and Debug online from anywhere in world. *******************************************************************************/ #include #include typedef unsigned int uint; bool esPalindromeRec(char *frase, uint inf, uint sup) { bool res; if (inf >= sup) res = true; else if (frase[inf] != frase[sup]) res = false; else res = esPalindromeRec(frase, inf + 1, sup - 1); return res; } bool esPalindrome(char *frase, uint largo) { return esPalindromeRec(frase, 0, largo - 1); } int main() { char palabra[] = "anana"; uint len = 5; bool esPalindromo = esPalindrome(palabra, len); if (esPalindromo) { printf("La palabra '%s' es un palĂ­ndromo.\n", palabra); } else { printf("La palabra '%s' no es un palĂ­ndromo.\n", palabra); } return 0; }