3. Visual Basic loop structures allow to run one or more lines
of code repetitively
Statements in a loop structure can be repeated
Until a condition is True
Until a condition is False
A specified number of times, or
Once for each element in a collection
4. Types of Looping:
There are mainly 3 types of loop:
For Loop
While Loop
Do Loop
12/26/03AVL Trees - Lecture 8
5. One of the Do Loop statements variations is the Do
While and it executes as long as a condition is true
(while a particular condition is true).
Loop will get stops when condition is False.
Exit DO can be use to exit from loop anytime.
Syntax:-
Do {While} condition
statements
[Exit Do]
statements
Loop
6. Example of Do While
Print Table
Module Module1
Sub Main()
Dim a, i As Integer
a = 1
console.writeline("Enter the number")
i =Console.ReadLine()
Do While a < 10
a = a + 1
Console.WriteLine(a * i)
Loop
Console.ReadKey()
End Sub
End Module