by Dinesh Thakur Category: Lists Loops and Printing

 

PreTest Do/Loop

 

PostTest Do/Loop

 

1. Do-while tests the loop condition each time through the loop & it keeps executing while the test expression is a true value.

 

Loop while we check the condition at the bottom.

 

2.When the conditional expression is false then

 

When the loop while is used ,the body of loop

the statements in Do/Loop are skipped.

is executed at least once, since the condition is at the bottom of the loop.

 

3. General Syntax is :

Do while <condition>

<statements>

Loop General Syntax is

General Syntax is :

Do

<statements>

Loop while<condition>

 

4. Ex.

Do While intNumber < 100

lblNumber.Caption=intNumber

intNumber = intNumber + 1

Loop

Ex. Dim intNum as integer

Do

Form1.print intNum

intNum = intNum +1

Loop while(intnum <= 10)

 



About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.