Tower Of Hanoi

Code Id 36
Date Updated 3/7/2010
Title Tower of Hanoi  
This program implements Tower of Hanoi. This has a historical basis in the historial basis in the ritual of the ancient Tower of Brahma.  
Codes Snippet
void Hanoi (int n, char initial, char final, char temp)
if (n==1)
        printf(�Move disk � 1 from %c to %c n�, initial, final);
Hanoi (n � 1, initial, temp, final);
printf(�Move disk � %d from %c to %c n�, n, initial, final);
Hanoi (n � 1, temp, final, initial);
void main()
int n;
printf(�Enter no. of disks to be moved�);

Comments are closed.