What is the *= operator? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is the *= operator?

15th Dec 2016, 12:42 AM
Nigel
3 Answers
+ 10
x *= y is shorter version of x = x * y
15th Dec 2016, 1:33 AM
Maksym Zieliński
Maksym Zieliński - avatar
+ 5
int x = 3; int y = 5; x *= y; //is equivalent to x = x * y; //Both statements end with x = 15
15th Dec 2016, 12:48 AM
Jafca
Jafca - avatar
+ 1
shortened multiplication operator k*=3; // same as k= k*3;
15th Dec 2016, 7:46 AM
Viral Parekh
Viral Parekh - avatar