What is the difference between while and do while loop in C?

whiledo while
Condition is checked firstBody runs first, condition is checked after
Body may run zero timesBody runs at least one time
No semicolon after the conditionSemicolon after while (condition);

Example: with int x = 10; and the condition x < 5, a while loop prints nothing, but a do while loop prints once. See do while loop.


Learn more about the similar topics:
Tutorials
No Content Found.
Exercises & Assignments
No Content Found.
Interview Questions & Answers
No Content Found.