Question: write a c program to solve the Hanoi tower problem using problem decomposition *no loops #include An example of using the function: to print the

write a c program to solve the Hanoi tower problem using problem decomposition *no loops #include

An example of using the function: to print the sequence of moves to move 3 discs on pole 2 to pole 1 using pole 3 as a temporal pole can be done by moveDiscs(3, 2, 3, 1).

Steps to use

1.move the top n-1discs from pole a to pole b;

2.print: Move disc n from pole a to pole c;

3.move the n-1 discs from pole b to pole c.

Output

Input the number discs on pole a: 2

Move disc 1 from pole 1 to pole 2.

Move disc 2 from pole 1 to pole 3.

Move disc 1 from pole 2 to pole 3.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!