Palindrome problem

The code is not able to satisfy 1 test case. Please check it once.
#include<bits/stdc++.h>
using namespace std;
static int f=0;
void palin(int a,int n,int i)
{
if(a[i]!=a[2
n-i-1] && i<n)
{
f=1;
}
else if(a[i]==a[2*n-i-1] && i<n)
{
i++;
palin(a,n,i);
}
}
int main() {
int n;
cin>>n;
int a[n];
for(int i=0;i<n;i++)
cin>>a[i];
palin(a,n/2,0);
if(f==1)
cout<<“false”;
else
cout<<“true”;
return 0;
}

@jha.aparna17 share your code here using cb ide

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.