Nested For Loop Iterations
What is the output of the following code?
public class NestedLoop {
public static void main(String[] args) {
int count = 0;
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 4; j++) {
count++;
}
}
System.out.println(count);
}
}
A
15
B
7
C
12
D
9
Question Leaderboard
Not enough data yet to show leaderboard.
APFIVE