Chapter 8: Iteration and recursion - Online Test

Q1. Which of the following is not an invariant of the assignment? m, n := m+2, n+3
Answer : Option D
Explaination / Solution:
No Explaination.


Q2.

If Fibonacci number is defined recursively as


to evaluate F(4) ,how many. timesF() is applied?
Answer : Option A
Explaination / Solution:
No Explaination.


Q3.

Using this recursive definition


how many multiplications are needed to calculate a10?

Answer : Option C
Explaination / Solution:
No Explaination.