June 2006
Intermediate to advanced
1344 pages
42h 52m
English
The Do While...Loop repetition statement behaves like the While repetition statement. As an example of a Do While...Loop statement, consider another version of the program designed to find the first power of 3 larger than 100 (Fig. 5.6).
1 ' Fig. 5.6: DoWhile.vb 2 ' Demonstration of the Do While...Loop statement. 3 Module DoWhile 4 Sub Main() 5 Dim product As Integer = 3 ' initialize product 6 7 ' statement multiplies and displays the 8 ' product while it is less than or equal to 100 9 Do While product <= 100 10 Console.Write(product & " " ) 11 product = product * 3 12 Loop 13 14 Console.WriteLine() ' write blank line 15 16 ' print ... |
Read now
Unlock full access