Do Until/Loop (2) : Do Until « Statements « VB.Net Tutorial






Module Tester

    Sub Main()
        Dim product As Integer = 2

        Do Until product > 1000
            Console.Write("{0}  ", product)
            product = product * 2
        Loop

        Console.WriteLine("Smallest power of 2 " & _
           "greater than 1000 is {0}", product)
    End Sub 

End Module
2  4  8  16  32  64  128  256  512  Smallest power of 2 greater than 1000 is 1024








4.11.Do Until
4.11.1.Do Until Loop
4.11.2.Do Until/Loop (2)