Tower of hanoi in hb

https://ide.codingblocks.com/#/s/30952
https://hack.codingblocks.com/contests/c/457/358
I used recursion. what’s wrong?

1 Like

https://ide.codingblocks.com/#/s/31066

I have made the changes and marked the mistakes.

#include

using namespace std;

void move(int n,char src,char helper,char dest)

{

if(n==0)

{

return;

}

move(n-1 ,src,helper,dest);

cout<<“Moving ring” <<" “<< n <<” “<< “From” <<” “<< src <<” “<< “to” <<” "<< dest << “\n”;

move(n-1,helper,dest,src);

}

int main() {

int n;

cin>>n;

move(n,‘A’,‘B’,‘C’);

return 0;

}

why i am getting wrong output