Join Examsbook
608 0

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 AnswerHide 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.

Are you sure

  Report Error

Please Enter Message
Error Reported Successfully