do-while Loop

  

2.do-while Loop:

This loop is used when the statement are to be executed initially and then the result of those statement is to be compare at the bottom of loop. In case if the condition is satisfied or true, the loop continues it is stopped. 

 

In this loop computer enters into the body of do-while first, execute it and then check the condition. If condition is true it goes back and continues till condition remains true, when condition false it goes to the next statement.

 

Syntax:


Flowchart:



Ex:

Display 1,2,........100



Comments