Increment and Decrement Operators
Increment and Decrement Operators
In C, ++ and -- are called increment and decrement operators respectively. Both of these operators are unary
operators, i.e, used on single operand. ++ adds 1 to operand and -- subtracts 1 to operand respectively. For
example:
Let a=5 and b=10
a++;
//a becomes 6
a--;
//a becomes 5
++a;
//a becomes 6
--a;
//a becomes 5
NOTE : ++a !=
a=a+1;
Output
2
4