While and Do while loop difference?

1) while statement executes a statement or a block of statements until a specified expression evaluates to false.
2) A while loop can be terminated when a break, goto, return, or throw statement transfers control outside the loop. To pass control to the next iteration without exiting the loop, use the continue statement.
3) The only difference between while and do while is a do-while loop is executed one time before the conditional expression is evaluated.


Comments