June 2006
Intermediate to advanced
1344 pages
42h 52m
English
Unlike the While and Do While...Loop repetition statements, the Do Until...Loop repetition statement tests a condition for falsity for repetition to continue. Statements in the body of a Do Until...Loop are executed repeatedly as long as the condition (known as the loop-termination condition) evaluates to false. The program of Fig. 5.7 finds the first power of 3 larger than 100 by using a Do Until...Loop repetition statement.
1 ' Fig. 5.7: DoUntil.vb 2 ' Demonstration of the Do Until...Loop statement. 3 Module DoUntil 4 Sub Main() 5 Dim product As Integer = 3 6 7 ' find first power of 3 larger than 100 8 Do Until product > 100 9 Console.Write(product ... |
Read now
Unlock full access