Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

In the anatomy of a while loop, what is the purpose of the 'Update' component?
Options
A To re-evaluate the loop's condition.
B To define the starting value of a variable.
C To print output to the console.
D It is essential to prevent infinite loops.
Correct Answer
Correct Answer

Option D is the correct answer.

Detailed Explanation

Slide 4 explicitly states: '+ Update: Essential to prevent infinite loops!'

Hint

Check the 'Anatomy of a While Loop' slide for the definition of 'Update'.

Question Info