Showing posts with label Operators. Show all posts
Showing posts with label Operators. Show all posts

Wednesday, October 27, 2010

Logical Operators

Logical operators perform conditional and, or, and not operations

And          : Used to evaluate two operands(values) as being true (or false)
Or            :
Used to evaluate one or more operands(values) as being true (or false)
Not          :
Used to evaluate whether an operand(value) is not true (or not false)

Multiplication

Code eg: Multiplication of two variables.

' Declare variables
Dim TotalDamage As Integer = 555
Dim TotalAgility As Integer = 6
 ' Create the expression
Dim TotalPoints As Integer = TotalDamage * TotalAgility

The expression in this example will evaluate to 3330.

Division


Code eg: Division of two integer variables

' Declare variables
Dim NumberOne As Integer = 9
Dim NumberTwo As Integer = 3
' Create the expression
Dim Result as Integer = NumberOne / NumberTwo

The expression in this example will evaluate to 3.

Arithmetic Operators


The following are arithmetic operators. They may be used in arithmetic expressions (maths problems)
  • + Addition Operator
  • - Subtraction Operator
  • / Division Operator
  • * Multiplication Operator