Do while loop in Visual Basic

Loop block that tests a specific condition before or after each pass through the loop. When this condition evaluates to False, the loop is exited.

Example

Module Module1

    Sub Main()

        Dim i As Integer = 0
        Do
            i += 1
            Console.WriteLine(i)
        Loop While i < 10

        Console.ReadLine()
    End Sub

End Module

Output

1
2
3
4
5
6
7
8
9
10
Share

You may also like...