Operators | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 1

Operators

I understand that if x=4 x*=3 The answer is 12. How does this work though? If x = x * 3 how can x be both the answer, and in the problem?

23rd Mar 2021, 5:03 PM
Skipps
2 Respostas
+ 3
Skipps There is no difference. x *= 3 is a short of x = x * 3 Same as above x += 3 // x = x + 3 x -= 3 // x = x - 3 x /= 3 // x = x / 3
23rd Mar 2021, 5:09 PM
AĶ¢J
AĶ¢J - avatar
0
x=4 x *= 3 ā—x = x * 3 ā—x = 4 * 3 ā—x = 12
25th Mar 2021, 4:54 AM
SorryPark