QuestionQ212

Using Loop Constructs

Given this code fragment:

Question Image

What is the output?

  • A 2 4
  • B 0 2 4 6
  • C 0 2 4
  • D Compilation fails.
Explanation

The for loop prints each even value of ii that is less than jj (7). Starting at 0 and incrementing by 2 produces 0 2 4 6.

Community Discussion

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