What are the operator types?

Arithmetic operators

  • +
  • *
  • /
  • ^ for exponents
  • % for modulus operator, gives the remainder of an integer after division (ex) 10 % 4 = 2

 

Comparison operators

  • == if two operands are equal (ex) 5==3 is false but 5==5 is true
  • <> if two operands are unequal (ex) 5<>3 is true but 5<>5 is false
  • >
  • <
  • >=
  • <=

 

Logical operators

  • and    true if both conditions are true
  • or     true if either conditions are true
  • not    true if its condition is false      (ex) Not(2>94) returns true
  • xor    true iff one expression is true and the other is false

 

Concatenation operators

  • + will either concatenate strings or add numeric values    (ex) 5+10=15, “hello”+” world”=”hello world”
  • & will always concatenate (ex) 5&10=510,”hello”&” world”=”hello world”
Advertisements