tower of hanoi in c explanation
tower of hanoi in c without recursion
tower of hanoi in c using stack
tower of hanoi algorithm in data structure
tower of hanoi using stack
tower of hanoi in c++
tower of hanoi in c using iteration
tower of hanoi program in java
Tower Of Hanoi Using Backtracking in c++ program
#include<iostream.h>#include<conio.h>
void tower(int,char,char,char);
void main()
{
int n;
clrscr();
cout<<"enter the disk number : ";
cin>>n;tower(n,'A','C','B');
getch();
}
void tower(int n,char from,char to,char aux)
{
if(n==1)
{
cout<<endl<<"move 1 from peg "<<from<<" to "<<to;return;
}
tower(n-1,from,aux,to);
cout<<endl<<"move "<<n<<" from peg "<<from<<" to "<<to;
tower(n-1,aux,to,from);
}