Are you taking CLEP classes? Try clep.ai
| preferred AP College board partner for AP classes
easy Solved by 1 students

Nested For Loop Iterations

Mark
< 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

9

B

12

C

7

D

15

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.

AI Tutor

How can I help?

APFIVE © 2020.
Email: apfive@apfive.org|Privacy Policy|