Can you explain me call stack of this program?

#include
using namespace std;
#include

int sub(char *in, char *out ,int i,int j,int &count){

if(in[i] == '\0'){
     out[j]='\0';
    cout<<out<<" ";
    count++;
    return count ;
}

sub(in,out,i+1,j,count);
out[j]=in[i];
sub(in,out,i+1,j+1,count);

}

int main()
{
char in[100],out[100];
int count=0;
cin>>in;

int x = sub(in,out,0,0,count);
cout<<endl<<x;
return 0;
}

Hey @Kirtee2002
Basically in a string, for generating the subsequences, you will either include a particular character(2nd recursion call) or not include a particular character(1st recursion call), and then you will call recursion to do the same work for rest of the string, i.e the function will be used to calculate the rest of the string.

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.