- 1
Here a is variable : Purpose of a++ operator ?
Guys i want to know the purpose a++ operator. Please answer me..
8 Answers
+ 4
It is used to increment the value of variable *a* by one.
+ 2
Both can be used to increment the value of *a* by 1.
Find the difference heređ
https://www.geeksforgeeks.org/difference-between-increment-and-decrement-operators/
+ 1
Very verry thanx for helping me
+ 1
a++ uses the current value of a and then increments by 1
so if you print a++ you will get it's current value of a but the next time you print a++ you will see that its increased by 1
++a increments the value by 1 and uses it.
so if you print ++a you will notice that the value has increased by 1 instantly.
0
I think ++a is used for increment
0
Rankush that's why we call them as post increment and pre increment ,like ++a pre-increment,a++ post increment
0
a++ is used for increment but it wouldnt return the increased variable immediately,
But ++a would return the increment