Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

According to the document, what is the most common reason an "Infinite Loop" occurs?
Options
A The <code>while</code> keyword is misspelled.
B The program runs out of memory.
C The loop's condition never becomes False.
Correct Answer
D The <code>print</code> statement is missing inside the loop.
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 7 states, "An Infinite Loop occurs when the condition never becomes False. This usually happens if you forget to update your variable inside the loop."

Hint

An 'infinite loop' implies that the loop's termination condition is never met.

Question Info