Do while() & while()

What is the minimum execution of do while() and while()?
if there is a change why is it so?

Questions by sivarama vinaykumar   answers by sivarama vinaykumar

Showing Answers 1 - 6 of 6 Answers

while is entry control statement which checks the condition before the compiler executes the statements in the loop.so the minimum execution of while is  '0'.
do while is a exit control statement.it executes the statements once and at the end of the loop it verfies the condition in the while statement which is in the end of the loop
hence the minimum execution of do while is '1'.

while :it checks the neccessary condition before the exexution of loop
if the condition=true then loop is executed and after one loop again the condition is checked and if true loop is again executed..and so on
if condition is false then loop is not executed ...
do while: in this type of loop once the loop is executed
now at the end of the loop the condition is checked
is it is true then loop is continued for execution else loop breaks
thus do while executes atleast once
but while do not executes for a single time if condition is false .......

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.