Control Structures examples

Module Module1

    Sub Main()

        'Dim a As Integer
        'Dim b As Integer

        'a = 10
        'b = 20
        'If (a > b) Then
        '    Console.Write(" a is big number")
        'Else
        '    Console.Write(" b is big number")
        'End If

        '' While Loop
        'Dim number As Integer

        'number = 1
        'While number <= 100
        '    number = number + 1
        '    Console.WriteLine("Number is{0}", number)
        'End While

        '' DO While Loop
        'Dim number As Long
        'number = 0
        'Do
        '    number = number + 1
        '    Console.WriteLine("Number is{0}", number)
        'Loop While number < 201

        'The For...Next Loop
        Dim x As Integer
        For x = 1 To 50
            Console.WriteLine(x)

        Next

        Console.ReadKey()
    End Sub

End Module

Comments

Popular posts from this blog

Visual Basic 6 (VB6) Operators

Control Structures In Visual Basic 6.0

C# Delegates simple example in .NET