Question 64

In the context of while loop and do-while loop in C++, which of the following is not true?

  1. ABoth the loops are repetitive in nature
  2. BBoth are conditional loops
  3. CBoth will be executed at least once
  4. DBoth are terminated when the condition becomes false.
Show answerHide answer

Correct answer: (C) Both will be executed at least once

Explanation

A do-while loop always runs at least once because it checks the condition after the body. A while loop may run zero times, so (C) is not true.

From DSSSB TGT Computer Science Practice Set 4

This is question 64 of DSSSB TGT Computer Science Practice Set 4. See all questions of this paper with answers, or attempt the paper as a timed online test to get your score and all-India rank.