Boolean value with And and Or : Arithmetic Operator « Operator « VB.Net Tutorial






Option Strict On
 Imports System
 Module Module1

    Sub Main( )

       Dim x As Integer = 5
       Dim y As Integer = 7

       Dim andValue As Boolean
       Dim orValue As Boolean
       Dim xorValue As Boolean
       Dim notValue As Boolean

       andValue = x = 3 And y = 7
       orValue = x = 3 Or y = 7
       xorValue = x = 3 Xor y = 7
       notValue = Not x = 3

       Console.WriteLine("x = 3 And y = 7. {0}", andValue)
       Console.WriteLine("x = 3 Or y = 7. {0}", orValue)
       Console.WriteLine("x = 3 Xor y = 7. {0}", xorValue)
       Console.WriteLine("Not x = 3. {0}", notValue)

    End Sub 'Main

 End Module
x = 3 And y = 7. False
x = 3 Or y = 7. True
x = 3 Xor y = 7. True
Not x = 3. True








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