Please tell error in this it is not covering all testcases

Use this line of code
for(int i=0,j=N-1;i<=j;i++,jā€“)
{
if(ar[i]==ar[j]) flag=true;
else
{
flag=false;
break;
}
}