- While loop checks the condition first and then executes the statement(s), whereas do while loop will execute the statement(s) at least once, then the condition is checked.
- While loop is entry controlled loop, whereas do while is exit controlled loop.
- In the while loop, we do not need to add a semicolon at the end of a while condition, but we need to add a semicolon at the end of the while condition in the do-while loop.
- While loop statement(s) is executed zero times if the condition is false, whereas the do-while statement is executed at least once.
- While loop allows initialization of counter variable before starting the body of a loop, whereas do while loop allows initialization of counter variable before and after starting the body of a loop.