QUESTION IMAGE
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
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 \).
Snap & solve any problem in the app
Get step-by-step solutions on Sovi AI
Photo-based solutions with guided steps
Explore more problems and detailed explanations
6 times (corresponding to the option "6 times")