Nested For Loop Iterations
Consider the following code segment. How many times will the body of the inner loop be executed?
for (int i = 1; i <= 3; i++) {
for (int j = 2; j < 5; j++) {
// inner loop body
}
}
A
9
B
7
C
8
D
6
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | michael.2103ll | 2 | 2 | - | 200 |
| #2 | manveergunesani | 1 | 1 | 0m 17s | 83 |
| #3 | busemagngr | 1 | 1 | 0m 26s | 74 |
| #4 | fatimaanany808 | 0 | 1 | 0m 02s | -12 |
Items per page:
10
1 – 4 of 4
