Home / Questions / What is the difference between while and do-while loops in C and Java?
Explanatory Question

What is the difference between while and do-while loops in C and Java?

👁 1,427 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

  • While loop is executed only when given condition is true.
  • Whereas, do-while loop is executed for first time irrespective of the condition. After executing while loop for first time, then condition is checked.