Nested Loop Iteration Count
What is the total number of iterations executed by the nested loops?
for (int i = 0; i < 4; i++) {
for (int j = i; j < 4; j++) {
System.out.print(j);
}
}
A
12
B
10
C
8
D
9
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | bommasam000 | 3 | 3 | 1m 06s | 234 |
| #2 | theofanusmischa | 1 | 1 | 0m 00s | 100 |
| #3 | singhris000 | 1 | 1 | 2m 25s | -45 |
| #4 | suhanakochhar006 | 0 | 1 | 2m 03s | -133 |
| #5 | y.seong2027 | 1 | 3 | 6m 29s | -309 |
| #6 | geethasailaja | 1 | 4 | 6m 19s | -309 |
| #7 | sailajavadlamani33 | 0 | 1 | 7m 51s | -481 |
APFIVE