what’s wrong in the below code ?
#include
using namespace std;
bool isPalindrome(int arr[],int size,int low, int high)
{
//base condition
if(size == 0 || size == 1)
return true;
//recursion call and self work
if(arr[low] == arr[high])
isPalindrome(arr,size,low+1,high-1);
else
return false;
}
int main()
{
int n,x,i;
cin>>n;
int arr[n];
while(n–)
{
cin>>x;
arr[i]=x;
}
if(isPalindrome(arr,n,0,n-1))
cout<<"true";
else
cout<<"false";
return 0;
}