Q: Which of the following languages does not support a do-while loop?
-
A
C++
-
B
Java
-
C
Python
-
D
C#
C
Answer:
C
Explanation:
Python does not have a built-in do-while loop. Instead, it only supports the traditional while loop, which checks the condition before executing the loop body. In contrast, languages like C++, Java, and C# all support both while loops and do-while loops. In these languages, a do-while loop is structured to ensure that the loop body executes at least once, even if the condition is false from the beginning.
Related Topic:
Share Above MCQ