The short way to write arithmetic operations on a variable and one operand

Syntax
x += y; // equal x = x + y;
x -= y; // equal x = x – y;
x *= y; // equal x = x * y;
x /= y; // equal x = x / y;
Parameters
x: any type variable
y: any type variable or const
Example
x = 2;
x += 4; // x equal 6
x -= 3; // x equal 3
x *= 10; // x equal 30
x /= 2; // x equal 15

Avatar photo
Alex P./ author of the article

xvsdfsdfsdfsd

Like this post? Please share to your friends:
The Men's Cave
Leave a Reply

;-) :| :x :twisted: :smile: :shock: :sad: :roll: :razz: :oops: :o :mrgreen: :lol: :idea: :grin: :evil: :cry: :cool: :arrow: :???: :?: :!: