← Quiz: Java Control Flow: all 10 questions
Quiz: Java Control Flow · Question 4 of 10
What does this print? (code)
What does this print?
public class Main {
public static void main(String[] args) {
int count = 0;
for (int i = 0; i < 10; i += 3) {
count++;
}
System.out.println(count);
}
}
- A.3
- B.4
- C.10
- D.5
Answer & explanation
Correct answer: 4
i takes 0, 3, 6, 9 — four rounds.
Can you get the rest right without peeking?
Take the timed Quiz: Java Control Flow quiz free. Pass it to earn XP and count towards your certificate.
Start the quiz →