Why this code not prints the output lexicographically?

void Subsequences(char* input , char* out, int i ,int j )
{
if(input[i] == ‘\0’)
{
out[j] = ‘\0’;
cout<<out<<endl;
return;
}
Subsequences(input , out , i+1,j);
out[j] = input[i];
Subsequences(input , out,i+1,j+1);
}
int main()
{
int n;
cin>>n;
char input[n];
cin.getline(input , n);
char out[100];
Subsequences(input , out , 0 ,0);
return 0;
}

void Subsequences(char* input , char* out, int i ,int j ) { if(input[i] == ‘\0’) { out[j] = ‘\0’; cout<<out<<endl; return; } Subsequences(input , out , i+1,j); out[j] = input[i]; Subsequences(input , out,i+1,j+1); } int main() { int n; cin>>n; char input[n]; cin>>input; char out[100]; Subsequences(input , out , 0 ,0); return 0; }