Give example of the do while loop, C/C++ Programming

Assignment Help:

The do..while Loop

The general format is as follows :

                do

{

                                statements;

                                :

                                :

                 }             while(condition);

 

e.g.

                do

                 {

                                cout << x;

                 }             while( x < = 10);

The do.. while loop is exactly like while loop, with single difference. Here testing is done after implementing the statements inside the loop and if the condition evaluates to true then we enter the loop again ,while in while only after the expression is checked we enter the loop.  We can say do loop is implemented at least once.

 


Related Discussions:- Give example of the do while loop

Is always the default constructor for fred fred::fred()?, Is always the def...

Is always the default constructor for Fred Fred::Fred()?

Standard template library , The STL details are described in many places on...

The STL details are described in many places online (see the CS377 webpage for some links), and there's a very quick introduction in Section A.14. Here are just a few additional no

Need programmer to program a flex pcb, Project Description: I want a per...

Project Description: I want a person who will be able to program a flex PCB for my device as i meet the person i will be able to describe all my needs Skills required are C P

Optimize and profile a c++ library for speed, Optimize and Profile a C++ li...

Optimize and Profile a C++ library for speed Project Description:  Optimize and Profile an existing C++ library for speed. This library uses OpenMP and OpenCV and C++ stan

Define local classes, A cl a s s c a n b e d e f i n e ...

A cl a s s c a n b e d e f i n e d i n s i d e a b l o c k o r f u n c t i o n.   T h i s t yp e cla s s i s known

Write procedure that compute recursive method, A function f is defined by t...

A function f is defined by the rule that f(n) = n if 0≤n≤3 and f(n) = f(n - 1) + 2f(n - 2) + 3f(n - 3) if n> 3. (a) Write a procedure that computes f by means of a recursive pro

Design a game in c, Design a game in c: const DODGERS = 0; const GI...

Design a game in c: const DODGERS = 0; const GIANTS = 1;   void main(void) {    int scoreboard [2][9];    // An array two rows by nine columns    int team, i

New customer, #questionhow can i add new customer and alot him a new unique...

#questionhow can i add new customer and alot him a new unique id ..

Differentiate between the expression ++a and a++, Differentiate between the...

Differentiate between the expression "++a" and "a++"? - With ++a, increment happens first on variable a, and resulting value is used. This is known as prefix increment. - Wi

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd