Sovi.AI - AI Math Tutor

Scan to solve math questions

QUESTION IMAGE

question: 10 how many times would the phrase codehs be printed in the f…

Question

question: 10 how many times would the phrase codehs be printed in the following sc repeat 3 times { repeat 2 times { println(\codehs\); } } 3 times 6 times 15 times 5 times

Explanation:

Step1: Analyze inner loop

The inner loop runs 2 times, so the println("codeHS") is executed 2 times per inner loop iteration.

Step2: Analyze outer loop

The outer loop runs 3 times. For each outer loop iteration, the inner loop runs 2 times. So total executions = outer loop count × inner loop count = \( 3 \times 2 = 6 \).

Answer:

6 times (corresponding to the option "6 times")