Pls check my code where i am doing wrong

correct function code:
bool reverse(int *a,int sum,int i,int n){
if(i==n){
return 0;
}
if(sum+a[i]==0){
return 1;
}
return reverse(a,sum,i+1,n) || reverse(a,sum+a[i],i+1,n);
}

still getting wrong anser

You are actually printing reverse output in main function. yes if sum not zero and vice versa. Correct it.