These opeators are used to increment or decrement the value of a variable. There are two ways to do it by using prefix, meaning that the operator precedes the variable eg: ++count. Second is postfix meaning that operator follows the variable eg: count++.
For eg: a = ++count;
In this statement value of count is incremented by 1 and then assigned to the variable a.
Second eg: a = count++;
In this value of count variable is assigned to variable a and then incremented by 1.
Increment operator
Decrement operator
Remember You can increment or decrement value of variable, but not about constant Eg: 1++; or (3+2)++; |