What kind of controlled structure is used when we don’t know the exact number of times a code needs to be executed?
Answer options
A
switch
B
while
C
for
D
if-else
Correct answer: while
Explanation
A 'while' loop is used when the exact number of iterations is unknown ahead of time — it continues as long as a condition is true. A 'for' loop is used when the iteration count is known; 'switch' and 'if-else' are selection structures, not iteration structures.