Operators and Expressions – Part IV (Increment and Decrement Operator)

We have already talked about the arithmetic operators and assignment operators. Now in this post we will see about the increment and decrement operator.

Increment and Decrement Operator:

Increment and Decrement Operator in C

Increment (++) and decrement (–) operators are unary operators because they operate on only the single operand. The increment operator (++) increments the value of the variable by one and decrement operator (–) decrements the value of the variable by 1.

++x is equivalent to x = x + 1

–x is equivalent to x = x -1 Continue reading