0% found this document useful (0 votes)
12 views7 pages

4 Operators

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

4 Operators

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Computer

Programming
2

Operators
Arithmetic Operators
OPERATOR MEANING
^ Used to raise a number to the power of
an exponent
* Used to multiply two numbers
/ Used to divide to numbers an return a
floating-point result
\ Used to divide to numbers an return an
integer result (Integer Division)
MOD Used to divide to numbers an return only the remainder
(Integer
Remainder)
+ Used to sum two numbers
- Used to find the difference between two numbers or to
indicate the
negative value of numeric expression
Relational Operators
• The execution of the block If is controlled by a
Boolean Expression.

• A Boolean Expression can be either True or False.

• Boolean Expressions are formed by using six


Relational operators and three Logical operators.
Relational Operators
MATHEMATICAL VISUAL BASIC NUMERIC MEANING
NOTATION NOTATION
= = Equal to
# <> Unequal to
< < Less than
> > Greater than
<= <= Less than or equal
>= >= Greater than or equal
Logical Operators
• The result of a logical operator is also True or False.

OPERATOR SYMBOL
AND And
OR Or
NOT <>
Assignment Statements
• The simplest statement is the assignment statement.
It consists of a variable name (var), followed by the
assignment operator (=), followed by an expression
(expr).
Example:
StartTime = Now
Explorer.Caption = “Captain marvel”
count = count + 1
num = 5
count = count + num /2
Comment Statements
• An apostrophe (‘) can be used to indicate comments;
comments are ignored by Visual Basic.

• The keyword Rem can also be used instead of an


apostrophe for comments.

• Remarks can also be placed after program statement


too.

You might also like