🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← 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?

  1. A.0
  2. B.1
  3. C.Infinite
  4. 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 →