You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
' ^ : It is an exponentiation Operator that is used to raises one operand to the power of another operand. Y ^ X (X to the power Y)
5
+
' + : The addition Operator is used to add numeric data, as well as concatenate two string variables. X + Y
6
+
' - : It is a subtraction Operator, which is used to subtract the second operand from the first operand. X - Y
7
+
' * : The multiplication Operator is used to multiply the operands X * Y
8
+
' / : It is a division Operator used to divide one operand by another operand and returns a floating-point result. X / Y
9
+
' \ : It is an integer division Operator, which is similar to division Operator, except that it returns an integer result while dividing one operand to another operand. X \ Y
10
+
' Mod : It is a modulo (Modulus) Operator, which is used to divide two operands and returns only a remainder. X Mod Y
' = : It checks whether the value of the two operands is equal; If yes, it returns a true value, otherwise it shows False. (A = B)
5
+
' <> : It is a Non-Equality Operator that checks whether the value of the two operands is not equal; it returns true; otherwise, it shows false. (A <> B), check Non-Equality
6
+
' > : A greater than symbol or Operator is used to determine whether the value of the left operand is greater than the value of the right operand; If the condition is true, it returns TRUE; otherwise, it shows FALSE value. (A > B); if yes, TRUE, Else FALSE
7
+
' < : It is a less than symbol which checks whether the value of the left operand is less than the value of the right operand; If the condition is true, it returns TRUE; otherwise, it shows FALSE value. (A < B); if the condition is true, returns TRUE else FALSE
8
+
' >= : It is greater than equal to which checks two conditions whether the first operand is greater than or equal to the second operand; if yes, it returns TRUE; otherwise, it shows False. A >= B
9
+
' <= : This symbol represents less than equal to which determines the first operand is less than or equal to the second operand, and if the condition is true, it returns TRUE; otherwise, it shows FALSE. A <= B
10
+
' Is : The Is Operator is used to validate whether the two objects reference the same variable or object; If the test is true, it returns True; otherwise, the result is False. In short, it checks the equality of the objects. An Is Operator is also used to determine whether the object refers to a valid object. result = obj1 Is obj2
11
+
' IsNot : The IsNot Operator is similar to Is Operator, except that the two object references the different object; if yes, the result is True; otherwise, the result is False. Result = obj1 IsNot obj2
12
+
' Like :The Like Operator is used to check the pattern expression of string variable; And if the pattern matched, the result is True; otherwise, it returns False. result = string Like the pattern, the pattern represents the series of characters used by Like Operator.
13
+
14
+
ImportsSystem
15
+
16
+
moduleComparisionOperators
17
+
submain()
18
+
19
+
dimxasinteger=5
20
+
dimyasinteger=10
21
+
dimresult,obj1,obj2asobject
22
+
dimstr1,str2asstring
23
+
str1="Apple12345"
24
+
str2="Apple12345"
25
+
obj1=10
26
+
obj2=20
27
+
28
+
Console.WriteLine("x = y : {0}",x=y)
29
+
Console.WriteLine("x <> y : {0}",x<>y)
30
+
31
+
Console.WriteLine("obj1 = obj2 : {0}",obj1=obj2)
32
+
Console.WriteLine("obj1 is obj2 : {0}",obj1isobj2)
' And : The And Operator represents, whether both the operands are true; the result is True. (A And B), result = False
5
+
' Or : It is an Or Operator that returns a true value; if anyone operand is true from both the operands. (A Or B), result = True
6
+
' Not : The Not Operator is used to reverse the logical condition. For example, if the operand's logic is True, it reveres the condition and makes it False. Not A Or Not(A And B) is True
7
+
' Xor : It is an Exclusive OR Operator that represents, whether both the expression is true or false, the result is True; otherwise, the result is False. A Xor B is True
8
+
' AndAlso : It is a logical AND Operator that performs short-circuit operation on the variables, and if both the operands are true, the result is True else the result is False. A AndAlso B = False
9
+
' OrElse : It is a logical OR Operator that perform short-circuit operation on Boolean data. If anyone of the operand is true, the result is True else the result is False. A OrElse B = True
10
+
' IsFalse : The IsFalse Operator is used to determine whether an expression is False.
11
+
' IsTrue : The IsTrue Operator is used to determine whether an expression is True.
12
+
13
+
ImportsSystem
14
+
15
+
moduleBitwiseOperators
16
+
submain()
17
+
dimaasboolean=true
18
+
dimbasboolean=false
19
+
console.writeline("a and b : {0}",aandb)
20
+
console.writeline("a or b : {0}",aorb)
21
+
console.writeline("a xor b : {0}",axorb)
22
+
console.writeline("not(a and b) : {0}",not(aandb))
' & : It is an ampersand symbol that is used to bind two or more operand together. Furthermore, a nonstring operand can also be concatenated with a string variable ( but in that case, Option Strict is on). Result = Wel & come, Result = Welcome
5
+
' + : It is also used to add or concatenate two number or string. Result = Wel + come, Result = Welcome
'the Exit statement is used to terminate the loop (for, while, do, select case, etc.) or exit the loop and pass control immediately to the next statement of the termination loop.
4
+
5
+
ImportsSystem
6
+
7
+
moduleExitStatement
8
+
submain()
9
+
dimiasinteger
10
+
11
+
console.writeline("------Exit with for-----")
12
+
fori=1to10step1
13
+
ifi>5then
14
+
exitfor' exit for loop
15
+
endif
16
+
console.writeline("i : {0}",i)
17
+
next
18
+
19
+
console.writeline("------Exit with while-----")
20
+
i=1
21
+
whilei<10
22
+
ifi>5then
23
+
exitwhile' exit while loop
24
+
endif
25
+
console.writeline("i : {0}",i)
26
+
i+=1
27
+
endwhile
28
+
29
+
console.writeline("------Exit with do while-----")
0 commit comments