Computer Science, asked by TAXAK, 9 months ago

explain any five Visual Basic operators with example​

Answers

Answered by MoonGurl01
26

Operators in Visual Basic are:

  • Arithmetic Operators
  • Comparison Operators
  • Logical/Bitwise Operators
  • Bit Shift Operators
  • Assignment Operators
  • Miscellaneous Operator

1. Arithmetic Operators

It includes basic arithmetic operations like addition, subtraction, multiplication, division, modulus operations, increment, and decrement.

Example: ^ , + , - , * , / , \

2. Comparison Operators

Example: = , < , > , >= , <=

3. Logical/Bitwise Operators

It refers to the boolean values which can be expressed as:

◆ Binary logical operations, which involves two variables: AND and OR

◆ Unary logical operation: NOT

Example: And, Or, Not

4. Bit Shift Operators

It is based on the principle of performing operations bit by bit which is based on boolean algebra. It increases the processing speed and hence the efficiency of the program.

5. Assignment Operators

It is used to assign a particular value to a variable.

(a) = (Assignment)- Used to assign a value from right side operand to left side operand.

(b) += (Addition Assignment)- To store the sum of both the operands to the left side operand.

6. Miscellaneous Operator

Apart from the above-discussed operators, there are certain operators which fall under this category which include sizeof and ternary (conditional) operators.

(a) sizeof – It returns the memory occupied by the particular data type of the operand

(b) & (Pointer) – It refers to the address (memory location) in which the operand is stored.

(c) * (Pointer) – It is a pointer operator

(d) ? (Condition) – It is an alternative for if-else condition

Similar questions