Recursion subsequences(not getting desired output)

The approach you are using in your code is not correct, basically you need to take two strings, one as input and other as an empty string as ,void printsubsequences(string str,string osf)
Then u need to check if string length is 0 or not, if it is 0, then simply print …
cout<<osf<<" ";
return;
else
char ch=str[0];
string ros=str.substr(1);
printsubsequences(ros,osf);
printsubsequences(ros,osf+ch);
This is the basic approach you need to follow up for printing the subsequences and also counting them as well.

Since, you arent replying anything, I am marking this doubt as resolved, You can reopen it if u still face any issues…