Increment and Decrement Operators

Increment and Decrement Operators


Increment operators are used to increase the value of the variable by one and decrement operators are used to decrease the value of the variable by one in C programs.

Type of Increment Operator

  • Pre increment/decrement Operator (++a, --a)
  • Post increment/decrement Operator (a++, a--)

In pre increment / decrement first increment/decrement the value of variable and then used inside the expression (initialize into another variable)

In post-increment / decrement first value of variable is used in the expression (initialize into another variable) and then increment / decrement the value of variable.