public static boolean compare(int[] a,int n)
{
for(int i=0;i<n;i++)
{
for(int j=i+1;j<n;j++)
{
if((a[i]*a[j])%2==0)
return false;
else
return true;
}
}
}
there's an error coming when I try to include this function in my prog. I think the place of return true is causing problem.When I write the return statement outside the two for loops then there is no error. Why is it like this?