C-17-Q140mediumsingle_mcq
Which of the following loops is most appropriate when the number of iterations is known in advance?
Which of the following loops is most appropriate when the number of iterations is known in advance?
- a
while - b
for - c
match - d
if
ব্যাখ্যা
A for loop iterates over a fixed sequence (such as range), so it is the natural choice when the iteration count is known beforehand. A while loop suits cases where iterations depend on a condition rather than a known count.