Get Started
393

Q:

What is the difference between do-while and while condition?

  • 1
    In do-while, a semicolon is used after the condition.
  • 2
    Semicolon is not used in While
  • 3
    While statement is after the condition
  • 4
    none of the above
  • Show Answer
  • Workspace

Answer : 4. "none of the above"
Explanation :

The key difference lies in when the loop condition is checked. In the while loop, the condition is checked before the first iteration, potentially resulting in zero iterations. In the do-while loop, the condition is checked after the first iteration, ensuring that the loop body is executed at least once.

The Most Comprehensive Exam Preparation Platform

Get the Examsbook Prep App Today