Question Detail

BIO 107 While Loops & Control Flow Objective Question

Question

If your program is stuck in an infinite loop, what action is recommended on the 'Stopping a Runaway Loop' slide to immediately stop the program?
Options
A Press <code>Alt + F4</code>
B Type <code>exit()</code> in the terminal
C Press <code>Ctrl + C</code>
Correct Answer
D Restart the computer
Correct Answer

Option C is the correct answer.

Detailed Explanation

Page 8, 'Stopping a Runaway Loop,' clearly states: 'If your program is stuck in an infinite loop, press Ctrl + C in your terminal/console.' This sends an interrupt signal.

Hint

Look for the specific keyboard shortcut mentioned for an 'Emergency Stop' on page 8.

Question Info