QuestionQ7

VerifiedControl Flow – Conditional Blocks and Loops

How many stars will the following snippet print to the console?

Question Image

Explanation

The loop executes for i = 2 and i = 0, since both values satisfy i >= 0. Each iteration prints one star, for a total of two stars.

Community Discussion

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