Operators in VB.NET

Assignment Operator (=)


= sign is used as the assignment operator in VB.NET.
Example:
Dim x As Integer
x=10 'assign 10 to x variable
 

Arithmetic operators

Arithmetic operators are used to do mathematic operations.

Operator

Description

Example

Result

+

Addition

a=1+2

3

-

Subtraction

a=3-1

2

*

Multiplication

a=2*5

10

/

Division

10/2

5

Mod

Modulus (division remainder)

10 Mod 2

0

^

Power

a=3^2

 

a=9

\

Integer division

a=3\2

 

a=1


Comparison operators

The comparison operators are used in comparing values.

Operator

Description

Example

=

equal to

1=2 evaluated to false

<>

not equal

1<>2 evaluated to true

>

greater than

1>2 evaluated to false

<

less than

1<2 evaluated to true

>=

greater than or equal to

1>=2 evaluated to false

<=

less than or equal to

1<=2 evaluated to true





HTML Comment Box is loading comments...



This website intents to provide free and high quality tutorials, examples, exercises and solutions, questions and answers of programming and scripting languages:
C, C++, C#, Java, VB.NET, Python, VBA,PHP & Mysql, SQL, JSP, ASP.NET,HTML, CSS, JQuery, JavaScript and other applications such as MS Excel, MS Access, and MS Word. However, we don't guarantee all things of the web are accurate. If you find any error, please report it then we will take actions to correct it as soon as possible.