QuestionQ5

Control Structures and Iteration

How many lines does the following code print?

Question Image

Explanation

The loop increments x to 1 on its first iteration. Because 1 < 100, it executes one print statement and immediately exits the loop with break, so exactly one line is printed.

Community Discussion

No comments yet. Be the first to start the discussion!