How do i add the count of subsequences as it is also asked in the question could you please include that in my code

#include
#include
#include
using namespace std;
void generate_subsequence(char* in, char* out,int i,int j) {
if(in[i]==’\0’)
{
out[j]=’\0’;
cout<<out<<" ";
return;
}
//out[j]=in[i];
generate_subsequence(in,out,i+1,j);
out[j]=in[i];
generate_subsequence(in,out,i+1,j+1);
return;
}
int main() {
char input[1000];
cin>>input;
char output[1000];
generate_subsequence(input,output,0,0);
}

Hey @tarunasree123
Say array size is n
then total subsequence will be 2^n

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.