- 2
If x = 2 then after executing the statement “ x = x + x + +” the value of x will be
2 Antworten
+ 2
It will result in 4 it is better if you use (x++).
Because initially x=2 and after that x= 2+2 because you used post increment value so first 2 will be added and then x will be increased by 1.