0% found this document useful (0 votes)
533 views

Visual Basic 6.0 - Do While Loop

The document discusses the Do While loop structure in Visual Basic, which allows code blocks to be repeatedly executed as long as a given condition is true. It notes that the Do While loop uses comparison operators to check conditional expressions, like the If statement, and will continue looping until the condition evaluates to false. Examples are provided to illustrate how to use a Do While loop to repeatedly add 1 to a variable until it reaches a target value of 100, and to accept a grade input equal to or greater than 85.

Uploaded by

Liz Panganoron
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
533 views

Visual Basic 6.0 - Do While Loop

The document discusses the Do While loop structure in Visual Basic, which allows code blocks to be repeatedly executed as long as a given condition is true. It notes that the Do While loop uses comparison operators to check conditional expressions, like the If statement, and will continue looping until the condition evaluates to false. Examples are provided to illustrate how to use a Do While loop to repeatedly add 1 to a variable until it reaches a target value of 100, and to accept a grade input equal to or greater than 85.

Uploaded by

Liz Panganoron
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 6

DO WHILE LOOP

STRUCTURE
Definition
The is used
to execute statements until
a certain condition is met.
The Do While loop is perhaps the most common
looping statement that you'll put in Visual
Basic programs. Do While works with comparison
expressions just as the If statement does.
Therefore, the six comparison operators that
you learned about in the previous lesson work
as expected here. Rather than controlling the
one-time execution of a single block of code,
however, the comparison expression controls
the looping statements.
Format
Do While expression
[VB Statements]
Loop

Do
[VB Statements]
Loop While expression

Example
1. Make a program that does not exit while a'
is less than the value of 100. It keeps
adding 1 to a' and when a' reaches 100.
Example :D
Make a program that will accept a grade equal or
greater than 85 using the do while loop statement.

You might also like