0
When and why should we use x++ In stead of x=x+1?
8 Answers
+ 6
x++
++x
x = x + 1
x += 1
All mean the same thing, and there are really no drawbacks to any of them. When incrementing by 1, the most common method would be to just do x++.
It is important to consider them in loops, such as a for loop, however. x++ in a for loop will increment AFTER the body has executed.
0
They both mean the same thing.
0
no they are diffrent in executing
0
when you want. no they are diffrent.
0
prefix and postfix increment, for good discussion, you have to see in YouTube.. so, search in durgasoft YouTube videos..
0
they are the same
0
they are answer is always same
- 3
they are different