If inside Do While loop : Do While « Language Basics « VB.Net






If inside Do While loop

If inside Do While loop
Imports System

public class MainClass
    Shared Sub Main()
       Dim counterVariable As Integer = 0

       Do
          Console.WriteLine("counterVariable: {0}", counterVariable)
          counterVariable = counterVariable + 1

          If counterVariable > 9 Then
             Exit Do
          End If
       Loop

    End Sub

End Class



           
       








Related examples in the same category

1.Do While LoopDo While Loop
2.Do Loop while Do Loop while
3.Do Loop WhileDo Loop While
4.Exit a Do While LoopExit a Do While Loop