+ 6
in loop coding... is "x=x+2" and "x+=2" same?
7 Réponses
+ 11
x=x+2 //general form
x+=2 //shorthand assignment operator
both are same not only in loops but everywhere
+ 6
Yes, they are the same wether in a loop or not.
+ 2
yes it is the same
+ 2
Yes it is the same
+ 2
In C++,both the things are same,u can use anyone according to ur wish.
+ 1
Same
+ 1
yup they are same as long as u want in c++