Pls help me to debug the code

I have tried in another way too still its showing segmentation fault

You can use the following approach in your code as :

void printSubsequences(string inp, string out)
{
if (inp.size() == 0)
{
cout << out << " ";
return;
}

char ch = inp[0];
inp = inp.substr(1);
printSubsequences(inp, out);
printSubsequences(inp, out + ch);

}