+ 1

Could you tell how it happened?

What is the output of this code? x = 8 x /= 2 y = 1 x.times {y+=2} puts y

2nd Nov 2020, 6:24 PM
sunhack
sunhack - avatar
1 Odpowiedź
+ 2
What happend is that y first value is 1 and x value is 4 so the code will added 2 to y for four times so outputs ??https://code.sololearn.com/cJ1MfBxmEdBf/?ref=app
2nd Nov 2020, 6:33 PM
HBhZ_C
HBhZ_C - avatar