- Increment and Decrement Operators are Unary Operators(Unary Operator Operates on One Operand).
- Increment Operator is Used to Increment Value of variable by 1 (default).
- Decrement Operator is used to decrement value of Variable by 1 (default).
Types of increment and decrement operators.
1. Pre Increment / Pre Decrement Operator
2. Post Increment / Post Decrement Operator
Syntax:
Syntax:
++ Increment operator : increments a value by 1 -- Decrement operator : decrements a value by 1
Pre-Increment Operator:
“++” is written before Variable name.
No comments:
Post a Comment