0
Help me understand why b=0?
I got b equalling 0 as my result after I wrote this: var a = 2, b =4 b /= a print(b)
2 Answers
+ 1
b/=a
(b = b/a)
b = 4/2
b=2
+ 1
I checked your profile, this is the whole code, you didn't post it all.
var a = 1, b = 5, c = 3
a += 2 + b
print(a)
b /= a
print(b)
-------+++++------
since a = 8
b / a = 0
5/8 = 0
because it is an integer division it is 0.
convert a and b to Float.