Professional Documents
Culture Documents
Tutorial 6
Tutorial 6
Tutorial -6
Question:
1. Compare and contrast between iterative and recursive approaches in problem solving.
2. Write Java/Javascript code for the following requirements using iterative and recursive
approach.
a. the Fibonacci number ie., 0,1,1,2,3,5,8,13…
b. the Factorial number
3. Write a countdown(n) method using recursion concept that decrement the given number
by 1 with an interval of one second. Display each number until zero(0) reached.
Sample output:
5
4
3
2
1
Timeout!
5.