4. Arithmetic operators Arithmetic operators are used to perform arithmetic calculations such as addition and subtraction. VB.NET supported arithmetic are listed in the given table. www.ustudy.in
6. Comparison operators Comparison operators are used to compare two or more values. VB.NET supported comparison operators are listed in the following table. www.ustudy.in
8. Logical operators Logical operators are used to perform logical operations such as AND, OR, NOT on one or more expressions. www.ustudy.in
9. AND This operator is used as a conjunction of two conditions. The result of the AND operation is True only if both the conditions are true. Syntax: Result = Expression1 AND Expression2 www.ustudy.in
11. Example of AND Operator Dim a, b, c As Integer Dim d As Boolean a = 10 b = 20 c = 30 d = (a<b) AND (b<c) ‘Returns True’ d = (a>b) AND (b<c) ‘Returns False’ www.ustudy.in
12. OR This operator is used as a disjunction of two conditions. The result of the OR operator is false only if both the conditions are false. Syntax: Result = Expression1 OR Expression2 www.ustudy.in
14. Example of OR Operator Dim a, b, c As Integer Dim d As Boolean a = 10 b = 20 c = 30 d = (a<b) OR (b>c) ‘Returns True’ d = (a>b) OR (b>c) ‘Returns False’ www.ustudy.in
15. XOR The result this operator is True only if one of the conditions is true and other is false. Syntax: Result = Expression1 XOR Expression2 www.ustudy.in
17. Example of XOR Operator Dim a, b, c As Integer Dim d As Boolean a = 10 b = 20 c = 30 d = (a<b) XOR (b<c) ‘Returns False’ d = (a>b) XOR (b<c) ‘Returns True’ www.ustudy.in
18. NOT This logical operator is used to perform a logical negation on a boolean expression. Syntax: Result = NOT (boolean Expression) www.ustudy.in
20. Example of XOR Operator Dim a, b, c As Integer Dim d As Boolean a = 10 b = 20 c = NOT (a>b) ‘Returns True’ c = NOT (a<b) ‘Returns False’ www.ustudy.in
21. AndAlso This operator is same as AND operator but if the first condition is false then the second condition is not checked and the result is false. Syntax: Result = Expression 1 AndAlso Expression2 www.ustudy.in
22. OrElse This operator is same as OR operator but if the first condition is true then the second condition is not checked and the result is True. Syntax: Result = Expression 1 OrElse Expression2 www.ustudy.in
23. Concatenation operators Concatenation operators are used to join two string values. & and + are the two concatenation operators available in VB.NET. The operator & is used to concatenate two strings and + is used to add two numbers and concatenate two strings. www.ustudy.in