+ 1

# HELP!

What procedures should I perform to complete this? What is the output of this code? a = 8 a /= 3 puts 4%a

1 Answer

+ 4

The output of the code is 0. This is because a, which is 8, divided by 3 returns 2(8 / 3 = 2 with a remainder of 2), which is the whole number after dividing. We then print to the console the modular value of 4 divided by a(now 2), which returns 0 because there's a remainder of 0 after dividing 4 by 2. By the way, I suggest typing such simple problems in the Code Playground, to see the result without having to ask.