To check if a string is a palindrome using recursion

Given a string, check whether it is palindrome or not using recursion



#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int flag=1;

int palindrome(char *s,char *e)
{
   if(s==e && abs(s-e)==1)
    return flag;
    
   if(*s!=*e)
   {
     flag=0;
   }
   
   else
    return flag;
    
   palindrome((s+1),(e-1));
   
}

int main(void) {
   char *s,*e;
   
   s=(char*)malloc(sizeof(char));
   
   scanf("%s",s);
   
   e=(s+strlen(s)-1);
   
   if(palindrome(s,e))
    printf("palindrome");
    
   else
    printf("not a palindrome");
    
   return 0;
}