21.
Which of the following is an exit-controlled loop?
a) for
b) while
c) do-while
d) all of the mentioned
Answer: c
Explanation:
do-while is called exit controlled loop because in do-while termination condition is checked when we have executed the body of the loop i.e. we are exiting the body and then checking the condition, therefore, it is called exit controlled loop.
22.
Which of the following is an entry-controlled loop?
a) for
b) while
c) do-while
d) both while and for
Answer: d
Explanation:
Both while and for loops are called entry controlled loop because in both of them the termination condition is checked before we enter the body of the loop hence they are called entry controlled loop.
23.
In which part of the for loop termination condition is checked?
for(I;II;III)
{IV}
a) I
b) II
c) III
d) IV
Answer: b
Explanation:
In II part the termination condition of the for loop is checked.
24.
What is dynamic binding?
a) The process of linking the actual code with a procedural call during run-time
b) The process of linking the actual code with a procedural call during compile-time
c) The process of linking the actual code with a procedural call at any-time
d) All of the mentioned
Answer: a
Explanation: Binding of calls and variables with actual code at run-time is called dynamic binding. For example in the concept of polymorphism types are decided are defined during the execution of code which leads to the different function calls depending upon the types used this is called dynamic binding. As the function call is decided during the run-time therefore dynamic binding happens at run-time.
25.
What is static binding?
a) The process of linking the actual code with a procedural call during run-time
b) The process of linking the actual code with a procedural call during compile-time
c) The process of linking the actual code with a procedural call at any-time
d) All of the mentioned
Answer: bExplanation: Binding of calls and variables with actual code at compile-time is called static binding. For example normally whenever we declare a variable we define its type hence compiler knows what type should be binded to that variable i.e. compiler can decide about that variable this is called static binding.