Webinar recursion issue

i have written another code for subset sum problem.tell me what is the problem with it.why its not working?also explain the time complexity of the code given in the webinar for subsums problem
#include
using namespace std;
int subsetsum(int arr[],int n,int a,int b)
{

//base case
if(n==0)
{

    if(0>=a and 0<=b)
        return 1;
    else
        return 0;}
    int no1=subsetsum(arr,n-1,a,b);
    int no2=subsetsum(arr,n-1,a-arr[n-1],b-arr[n-1]);
    int no3;
    if(arr[n-1]<0)
         no3=subsetsum(arr,n-1,a-arr[n-1],b);
    else
        no3=subsetsum(arr,n-1,a,b-arr[n-1]);
    int no=no1+no2-no3;
    return no;

}
int main()
{

int arr[100];
int n,a,b;
cin>>a>>b;
for(int i=0;i<n;i++)
    cin>>arr[i];
int no=subsetsum(arr,n,a,b);
cout<<" number of subsets having sum between "<<a<< " and "<<b<<" both inclusive is: "<<no<<endl;
return 0;

}

Hello @Rj.25

There are some lines in your code which are extra and also logically wrong.
I have removed them.
Here is the modified code.

If you still need any help, leave a reply and I will help you out.

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.