| preferred AP College board partner for AP classes
easy Solved by 3 students
Nested For Loop Iterations
< Prev
Next >

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

Hint
Did You Know?
Explain Why
Explain All Answers
Check Answer
Show Correct Answer
Report Question

Question Leaderboard

Not enough data yet to show leaderboard.

No comments yet. Be the first to comment!

AI Tutor

How can I help?

APFIVE © 2020.
Email: [email protected]|Privacy Policy