Abdurahman Lab 5
Abdurahman Lab 5
Name: abdurahman
Roll no 21
Semester: 3rd
the user.
Procedure:
2. Write a simple function to print the Fibonacci series (0, 1, 1, 2, 3, 5, 8, 13, 21,
Procedure:
Procedure:
• The function prints n and recursively calls itself with the next Fibonacci pair (m, n +
m).
function.
Procedure:
• Otherwise, move n-1 disks recursively to the auxiliary peg, move the largest disk,
and then move the n-1 disks to the target peg
Conclusion:
I have implemented recursive and non-recursive solutions for calculating the factorial of a
number, printing the Fibonacci series, and solving the Tower of Hanoi problem. These tasks
helped me understand of recursion and iterative processes