Arithmetic Operators

Arithmetic Operator

An arithmetic operator is a symbol or character used in programming to perform mathematical operations on numbers. These operations include addition, subtraction, multiplication, division and others.

Types of Arithmetic Operators

Binary Operators:

  • Binary operators work with two operands.
  • Examples include addition, subtraction, multiplication, division, and modulus.

Unary Operators:

  • Unary operators operate on a single operand.
  • Examples include increment and decrement operators.

Compound Assignment Operators:

  • Compound assignment operators combine an arithmetic operation with assignment.
  • Examples include +=, -=, *=, /=, and %=.