Output discrepancy

i am having a small discrepancy in the output. can you help me alter that?
actually it requires ans like ‘cd’, but i am getting ‘dc’.

#include
#include
using namespace std;
void cnt(char *c){
int n=strlen©;
cout<<(1<<n);
}
void fun(char *c,int i,int n)
{
if(i==(1<<n))
return;
else{
int temp=i,no=n;
while(temp>0)
{
if(temp&1)
cout<<c[no-1];
temp=temp>>1;
no–;
}
cout<<" ";
fun(c,i+1,n);
}
}
int main() {
char c[100];
cin>>c;
int n=strlen©;
fun(c,1,n);
cout<<endl;
cnt©;
return 0;
}

Plz send your code by saving on ide . And also send the question as well