← Quiz: Java Control Flow: all 10 questions
Quiz: Java Control Flow · Question 2 of 10
How many times does a do-while loop run if the condition is false at the start?
How many times does a do-while loop run if the condition is false at the start?
- A.0
- B.1
- C.Infinite
- D.Depends on the compiler
Answer & explanation
Correct answer: 1
The body runs first and the condition is checked after, so it runs once.
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 →