Programming

do – while LOOP In C++….

do – while LOOP In C++

 

do – while Loop:

This loop is a next level of while loop it is defined as that it executes the code first than checks the condition. The code written within this loop will always execute at least one time before checking the condition.

Syntax:

In do – while loop the syntax is a little similar to while but the working is alot different.

 

The code written within this loop will always execute at least one time before checking the condition.

 

we write the condition with while but at the end of the loop. first it executes above code then it checks while condition.

 

 

 

 

Example 1:

Output:

Example 2:

Output:

2 Comments

2 Comments

Leave a Reply

Your email address will not be published.

Most Popular

To Top