Shortcut assignment operators : Arithmetic Operator « Operator « VB.Net Tutorial






Module Tester

    Sub Main()
        Dim A As Integer

        A = 0
        A += 10
        Console.WriteLine("A += 10 yields " & A)

        A -= 5
        Console.WriteLine("A -=5 yields " & A)

        A *= 3
        Console.WriteLine("A *= 3 yields " & A)

        A /= 5
        Console.WriteLine("A /= 5 yields " & A)

        A ^= 2
        Console.WriteLine("A = 2 yields " & A)

    End Sub

End Module
A += 10 yields 10
A -=5 yields 5
A *= 3 yields 15
A /= 5 yields 3
A ^= 2 yields 9








3.2.Arithmetic Operator
3.2.1.Shortcut assignment operators
3.2.2.Power calculator
3.2.3.Boolean value with And and Or