Regarding tower of hanoi problem

#include
using namespace std;

void towerofhanoi(int n, char src, char dest, char helper)
{

if(n==0)
{
    return ;
}
towerofhanoi(n-1,src,helper,dest);
cout<<"Moving ring "<<n<<" from "<<src<<" to "<<dest<<endl;   
towerofhanoi(n-1,helper,dest,src);

}

int main()
{
int n;
cin>>n;
towerofhanoi(n,‘A’,‘C’,‘B’);
return 0;
}
why all testcase are failing for this code

Hey @praveeng1234
While calling the towerofhanoi function, You’ve passed the arguments in the wrong order:-

the statement should be:-
towerofhanoi(n,'A','B','C');
because src = ‘A’, dest = ‘B’, helper = ‘C’

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.