Chapter 8: Iteration and recursion - Online Test

Q1. In iteration, the loop body is repeatedly executed as long as the loop condition is
Answer : Option A
Explaination / Solution:
No Explaination.


Q2. Recursion must have
Answer : Option C
Explaination / Solution:
No Explaination.


Q3. An invariant for the loop body is known as a
Answer : Option D
Explaination / Solution:
No Explaination.


Q4. A loop invariant is true at
Answer : Option D
Explaination / Solution:
No Explaination.


Q5. A loop invariant need not be true
Answer : Option D
Explaination / Solution:
No Explaination.


Q6. Each time the loop body is executed, the variables
Answer : Option B
Explaination / Solution:
No Explaination.


Q7. A property of the variables which remains unchanged by the execution of the loop body. This unchanging property is called
Answer : Option A
Explaination / Solution:
No Explaination.


Q8. A loop invariant need not be true
Answer : Option D
Explaination / Solution:
No Explaination.


Q9. We wish to cover a chessboard with  dominoes, the number of black squares and the number of white squares covered by dominoes, respectively, placing a domino can be modeled by
Answer : Option D
Explaination / Solution:
No Explaination.


Q10. If m x a + n x b is an invariant for the assignment a, b : = a + 8, b + 7, the values of m and n are
Answer : Option B
Explaination / Solution:
No Explaination.