Nested For Loop Iterations
What is the total number of times the line // Loop Body is executed by the following code segment?
for (int i = 1; i <= 3; i++) {
for(int j = 0; j < i; j++){
// Loop Body
}
}
A
7
B
5
C
8
D
6
Question Leaderboard
| Rank | |||||
|---|---|---|---|---|---|
| #1 | mtanarupi | 2 | 2 | 0m 00s | 200 |
| #2 | m6200415 | 1 | 1 | 0m 00s | 100 |
| #3 | raufyildirim95 | 1 | 1 | 0m 46s | 54 |
| #4 | mattaana000 | 1 | 1 | 1m 15s | 25 |
| #5 | lsj08030922 | 1 | 1 | 1m 58s | -18 |
| #6 | ngvandangthanh | 0 | 2 | 0m 00s | -20 |
| #7 | richa.tuli | 0 | 1 | 2m 54s | -184 |
Items per page:
10
1 – 7 of 7
APFIVE