#include <stdio.h>
#include <string.h>
void check_palindrome_recursion(char s[], int index) {
int fromend = strlen(s) - (index + 1);
if (s[index] == s[fromend]) {
if (index + 1 == fromend || index == fromend) {
printf("Palindrome\n");
return;
}
check_palindrome_recursion(s, index + 1);
}
else {
printf("Not palindrome\n");
}
}
int main() {
char s[10] = "abcdcba";
check_palindrome_recursion(s, 0);
return 0;
}
/*
run:
Palindrome
*/