Comparison operators are used to compare values.
= : Equality
<> : Inequality
> : Greater than
< : Less than
>= : Greater than or equal to
<= : Less than or equal to
Showing posts with label Expressions. Show all posts
Showing posts with label Expressions. 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)
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)
Labels:
and,
Expressions,
Logical Operators,
not,
Operators,
or
Expressions
An expression in a programming language is a combination of values, variables, operators, and functions that are evaluated to produce another value.
Subtraction
Code eg: Subtraction from two integer variables
' Declare variables
Dim TotalPointsPossible As Integer = 200
Dim TotalPlayerMisses As Integer = 50
' Create the expression
Dim TotalScore As Integer = TotalPointsPossible - TotalPlayerMisses
Dim TotalPlayerMisses As Integer = 50
' Create the expression
Dim TotalScore As Integer = TotalPointsPossible - TotalPlayerMisses
The expression in the example will evaluate to 150.
Addition
Code eg: Addition of two integer variables.
' Declare variables
Dim RoundOneScore As Integer = 5000
Dim RoundTwoScore As Integer = 4678
' Create the expression
Dim TotalScore As Integer = RoundOneScore + RoundTwoScore
Dim RoundTwoScore As Integer = 4678
' Create the expression
Dim TotalScore As Integer = RoundOneScore + RoundTwoScore
The expression in the example will evaluate to 9678
Subscribe to:
Posts (Atom)