VB.Net Tutorial/Statements/Counter Controlled Repetition — различия между версиями
Admin (обсуждение | вклад) м (1 версия) |
|
(нет различий)
|
Текущая версия на 15:54, 26 мая 2010
Using the For/Next structure to demonstrate counter-controlled repetition.
<source lang="vbnet">Module Tester
Sub Main() Dim counter As Integer For counter = 2 To 10 Step 2 Console.Write(counter & " ") Next End Sub
End Module</source>
2 4 6 8 10
Using the While structure to demonstrate counter-controlled repetition.
<source lang="vbnet">Module Tester
Sub Main() Dim counter As Integer = 2 While counter <= 10 Console.Write(counter & " ") counter += 2 End While End Sub
End Module</source>
2 4 6 8 10