Compare Do-While with While Statements?

Answer:

A Do-While loop looks like this:

do {

loop body

} while (condition);

and a While loop looks like this:

while (condition) {

loop body

}

The main difference is that the loop body is always run once in the Do-While loop, then the condition is checked to see if the loop should keep running. In a While loop, the condition is checked first, and it will not run the loop body at all if the condition is false.

First answer by Csanders0. Last edit by Csanders0. Contributor trust: 407 [recommend contributor recommended]. Question popularity: 3 [recommend question].