🎙 Free live masterclass · Sun, 29 Nov, 7:00 pm IST · Java Full Stack roadmap Register free →
Skills101
← Quiz: C Control Flow: all 10 questions

Quiz: C Control Flow · Question 10 of 10

When is a while loop a more natural choice than a for loop?

When is a while loop a more natural choice than a for loop?

  1. A.When you know exactly how many times to repeat
  2. B.When you repeat until something changes and do not know the number of rounds in advance
  3. C.When the body must run at least once
  4. D.When you need a loop counter
Answer & explanation

Correct answer: When you repeat until something changes and do not know the number of rounds in advance

For example, reading numbers until the user enters 0; for loops suit a known count, do-while a body that runs at least once.

Can you get the rest right without peeking?

Take the timed Quiz: C Control Flow quiz free. Pass it to earn XP and count towards your certificate.

Start the quiz →