"Wait, I've heard of increments, but what are these decrements after all?" We hear some of you say. OK, throw an increment in reverse and reputation, you've got your app a decrement. Let's try to know a little deeper...
Increment and decrement operators are used to increase or decrease the value of a variable.
<> कोड उदाहरण :
* * is used for exponentiation.
+ + is used to increase or addition.
- - is used for subtraction.
i. Increment Operator + +
Increment operators increase the numerical value of their operands by 1. When placed before the operand, it will return the incremented value. When placed thereafter, it will return the original or original value and then increment the operand.
ii. Decrement Operator - -
The decrement operator decreases the numerical value of its operand by 1. When placed before the operand, it will return the subtracted value. When placed after the operand, will return the original or original value and then subtract the operand.
<> कोड उदाहरण :
The ++ and - - operators can be used before and after the operands. When you use the increment/decrement operator after the operand, the value will be returned before the operand is incremented/decremented.
<> कोड उदाहरण :
Conscious ! - You can use parentheses to change the order of arithmetic operations, just as you learned in school in math. like this: var x = (100 + 50) * 3;
Comments