MCQ
How many total times will the body of these nested loops execute: for (i = 1; i <= 3; i++) { for (j = 1; j <= 2; j++) { } }
Unit-3 Programming Fundamentals
A 3
B 5
C 6
D 9
Explanation

The outer loop runs 3 times and the inner loop runs 2 times for each outer run, so 3 x 2 = 6 executions.