C++ program for tower of hanoi using recursion
C++ program for tower of hanoi using recursion #include <iostream> using namespace std; void toh(int n,char source,char destination,char helper){ if(n==0){ return; } toh(n-1,source,helper,destination); cout<<"move from"<<" "<<source<<"to"<<" "<<destination<<endl; toh(n-1,helper,destination,source); } int main() { int n; cin>>n; toh(n,'A','B','C'); return 0; }