Increment and decrement operators are unaryoperators that add or subtract one from their operand, respectively. They are commonly implemented inimperativeprogramming languages. C-like languages became notorious for featuring two versions (pre- and post-) of each operator with slightly different semantics.

Examples

int x;
int y;
// Increment operators
x = 1;
y = ++x; // x is now 2, y is also 2
y = x++; // x is now 3, y is 2
// Decrement operators
x = 3;
y = x--; // x is now 2, y is 3
y = --x; // x is now 1, y is also 1