In my function palindrome, i just successful to compare 1st char and last char only..
How do i compare the second char which is(A) and second last char which is (a)??
You never actually make a recursive call.
To be recursive, palindrome must call itself.
4 5 6 7 8
int palindrome (char *p1, char *p2)
{ if (tolower(*p1) != tolower(*p2))
returnfalse; // Not a palindrome
return palindrome (p1+1, p2-1); // check next pair of characters
}
Line 17: function prototypes should normally be in the global scope, not local scope. In this case, you don't need line 17 at all since palindrome precedes main().