What is the difference between a while statement and a do statement

A while statement checks at the beginning of a loop to see whether the next loop iterationshould occur. Ado statement checks at the end of a loop to see whether the next iteration of a loop shouldoccur. The dostatement will always execute the body of a loop at least once.

Showing Answers 1 - 1 of 1 Answers

ravi

  • Jan 3rd, 2007
 

While Loop:

1) It is entry controled loop.
2) It may executes or may not execute statements in side that body part.

Do While Loop:
1) It is a exit controled loop.
2)It Executes the atleast one statement of the body part.

  Was this answer useful?  Yes

Give your answer:

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

 

Related Answered Questions

 

Related Open Questions