In the context of while loop and do-while loop in C++, which of the following…

2018

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

  1. A.

    Both the loops are repetitive in nature

  2. B.

    Both are conditional loops

  3. C.

    Both will be executed at least once

  4. D.

    Both are terminated when the condition becomes false

Attempted by 245 students.

Show answer & explanation

Correct answer: C

Both while and do-while loops are conditional and repetitive in nature, and both terminate when the condition becomes false. However, only the do-while loop is guaranteed to execute at least once, because the condition is checked after executing the loop body. In a while loop, the condition is checked before execution, so it may not execute even once. Therefore, statement (c) is not true.

Explore the full course: Uppsc Polytechnic Lecturer 2025 Cs