Move All X at End


plz check the code why no output is displayed

Anshul, the approach you are following is not correct, You can use this approach as,
void movexatend(string str,string osf)
{
char ch=str[0];
if(str.length()==0)
{
cout<<osf;
return;
}
string ros=str.substr(1);
if(ch!=‘x’)
{
movexatend(ros,osf+ch);
}
else
{
movexatend(ros,osf);
cout<<ch;
}
}