Increment and Decrement Operator in C++:
The increment and decrement operators are unary operators.
The increment operator ++ adds 1 to its operand
The decrement operator -- subtracts 1 from its operand.
Increment Operator Example:
int number=5;
number= number+1;
- number+1 is same as number++
int number=5;
number++;
Decrement Operator Example:
int number=5;
number=number-1;
- number-1 is the same as number--
int number=5;
number--;
0 Comments