Recursion implementation on subsequences

#include<bits/stdc++.h>
using namespace std;
#define ll long long
int p=0;
int generatingsubsets(char input[],char output[],int i,int j,int n)
{
if(input[i]==’\0’)
{
cout<<output<<" ";
p++;
return 0;
}
//include
output[j]=input[i];
generatingsubsets(input,output,i+1,j+1,n+1);

 //exclude
 output[j]=' ';
 generatingsubsets(input,output,i+1,j,n+1);
 
 return p;

}
int main()
{
// let’s play
ios_base::sync_with_stdio(false);
cin.tie(NULL);
char input[100];
cin>>input;
char output[100];
int pp=generatingsubsets(input,output,0,0,0);
//cout<<“that’s all”<<endl;
cout<<endl<<pp;
}

Hello @sunneykumar309

call this line first.
i,e

add that before this line

after doing changes
i got

d> c cd b bd bc bcd a d add ac acd ab abd abc abcd
16

pls share ur code usng cb ide

@sunneykumar309

ur shared code is not running.
pls copy ur code correclty and share the link again.

please run this code.
May be this code is running

check now->

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.