C++ is one of the most versatile languages in the world. It is used nearly everywhere for everything… systems programming (operating systems, device drivers, database engines, embedded, Internet of Things, etc.)

Enter Header Image Headline Here

Saturday, 15 April 2017

C++ do....while Loop

                                      do....while Loop


The do..while loop is a variant of  the while loop with one inportant difference. The body of do ...while loop is executed once before the test expression is checked.

The syntax of do... while loop is:

 









How do...while loop works?

  • The codes inside the body of loop is executed at least once. Then, only the test expression is checked.
  • If the test expression is true, the body of loop is executed. This process continues until the test expression becomes false.
  • When the test expression isfalse, do...whileloop is terminated.


Flowchart of do...while Loop:
























Example : C++do....while Loop  




































Output:






0 comments:

Post a Comment

Popular Posts

Recent Posts

Categories

Unordered List

Text Widget