Please debugg my code,it's giving wrong answer

you are always return 0 from the function
you have to use the value of flag which you are sending as a parameter in the function

i have updated the code ,please look into it

still it’s giving wrong answer

use this code

i Asked for debugging my solution,you are sending me the solution,i can get that anywhere

i have comment all mistakes done by you
your code logic is not correct

correct logic:
logic 1
this is for any value of sum in this question sum value is 0;
Let isSubSetSum(int set[], int n, int sum) be the function to find whether there is a subset of set[] with sum equal to sum. n is the number of elements in set[].

The isSubsetSum problem can be divided into two subproblems
…a) Include the last element, recur for n = n-1, sum = sum – set[n-1]
…b) Exclude the last element, recur for n = n-1.
If any of the above the above subproblems return true, then return true.

Following is the recursive formula for isSubsetSum() problem.

isSubsetSum(set, n, sum) = isSubsetSum(set, n-1, sum) ||
isSubsetSum(set, n-1, sum-set[n-1])
Base Cases:
isSubsetSum(set, n, sum) = false, if sum > 0 and n == 0
isSubsetSum(set, n, sum) = true, if sum == 0

logic 2
there exist a subset whose sum is zero only when there are two numbers which are negative of other
so just iterate on array and find there exist a number negative of it

sorry for that
i give you solution because your apporach is wrong i think you start thinking in correct way after seeing solution