Question 81
How many times will a 'for (int $i = 0$; i < 5; i++)' loop execute its body?
i takes values 0, 1, 2, 3, 4 (5 distinct iterations) before i becomes 5 and condition i < 5 fails.
How many times will a 'for (int $i = 0$; i < 5; i++)' loop execute its body?
i takes values 0, 1, 2, 3, 4 (5 distinct iterations) before i becomes 5 and condition i < 5 fails.
Which OOP concept allows a new class (derived/child class) to inherit attributes and methods from an existing class (base/parent class)?
Inheritance facilitates code reuse by deriving child classes that inherit parent class fields and methods.
What statement in Python allows conditional branching across multiple alternative conditions?
Python uses 'elif' (short for else if) for chaining multiple conditional branches.
In Java and Python, which keyword is used inside a child class to explicitly refer to or call methods/constructors of its parent superclass?
The 'super' keyword references parent class implementations and constructors from child classes.
In C/C++, can floating point variables (float/double) be used as switch-case control expressions?
Switch statements require exact discrete match values (integer or character constants); float values are prohibited.