+ 2
Why do we need post increments and decrements? how are they useful?
3 Answers
+ 3
Post increments/decrements are useful when you need to use the value of the variable and then increment/decrement it.
There are a lot of use-cases, which are mainly connected with the logic of your code.
+ 2
they are shortcut of writing.
we can write a=d;
d=d+1; or just a=d++
- 1
{y=i++;}=={y=i;i=i+1;} and {y=++i;}=={i=i+1;y=i;}. I think that is convenient when using It in expression in loop. try the code below: {int i=0; i=i++;Console.writeline(i);}