0% found this document useful (0 votes)
26 views2 pages

Concatenation Operator

The document outlines various operators in VB.Net, including arithmetic, comparison, logical, concatenation, and assignment operators. It provides examples for each operator, demonstrating their usage with variables. Key operators include +, -, *, /, =, <>, And, Or, and &.

Uploaded by

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

Concatenation Operator

The document outlines various operators in VB.Net, including arithmetic, comparison, logical, concatenation, and assignment operators. It provides examples for each operator, demonstrating their usage with variables. Key operators include +, -, *, /, =, <>, And, Or, and &.

Uploaded by

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

VB.

Net supports various operators that are used to perform operations on variables
and values. Here are some of the commonly used operators in VB.Net:

1.
 Concatenation Operator:

 & (Concatenation)+ (Addition)
 - (Subtraction)
 * (Multiplication)
 / (Division)
 \ (Integer Division)
 Mod (Modulus or Remainder)

Dim result As Integer


result = 10 + 5 ' result is 15
result = 10 - 5 ' result is 5
result = 10 * 5 ' result is 50
result = 10 / 5 ' result is 2
result = 10 \ 3 ' result is 3 (integer division)
result = 10 Mod 3 ' result is 1 (remainder)

2.
Comparison Operators:

= (Equal to)
<> (Not equal to)
< (Less than)
> (Greater than)
<= (Less than or equal to)
>= (Greater than or equal to)

Dim a As Integer = 10
Dim b As Integer = 5
Dim result As Boolean

result = (a = b) ' result is False


result = (a <> b) ' result is True
result = (a < b) ' result is False
result = (a > b) ' result is True
result = (a <= b) ' result is False
result = (a >= b) ' result is True

3.
Logical Operators:

And (Logical AND)


Or (Logical OR)
Not (Logical NOT)

Dim x As Boolean = True


Dim y As Boolean = False
Dim result As Boolean

result = x And y ' result is False


result = x Or y ' result is True
result = Not x ' result is False

4.
Concatenation Operator:

& (Concatenation)

Dim str1 As String = "Hello"


Dim str2 As String = "World"
Dim result As String

result = str1 & " " & str2 ' result is "Hello World"

5.

Assignment Operator:

`=` (Assignment)

Dim a As Integer
a = 10

You might also like