Recursion-subsequences

#include
#include
#include
using namespace std;
void subsequences(char in[],char out[],int i,int j){
if(in[i]==’\0’){
out[j]=’\0’;
cout<<out<<" ";
return ;
}
out[j]=in[i];
subsequences(in,out,i+1,j+1);
subsequences(in,out,i+1,j);
}
int main(){
char in[100];
cin>>in;
char out[100];
int n=strlen(in);
subsequences(in,out,0,0);
cout<<endl<<pow(2,n);
}
whats wrong in this code?

@tishya_goyal
hello Tishya,
ur code is correct but the order of ouput is not in the required order.

to print output in required order
image
call this statement (statement in line number 13) before line no 11.

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.