Programmer's Wiki
Advertisement

Typical Operators[]

  • Addition +
  • Subtraction -
  • Multiplication *
  • Division /
  • Modulus %

Shortcut Operators[]

Variables can be used in an expression where the result is stored in the variable again.

var i = 2;
i = i + 5

This can be simplified in some languages to make it easier write.

  • Addition: +=
  • Subtraction: -=
  • Multiplication: *=
  • Division: /=
var i = 2;
i += 5

Unary Operators[]

using a counter is quite common in many programming tasks.

i++;

increases the count by one.

i--;

decreases the count by one.

These are most commonly seen in For loops

See Also[]

Advertisement