Determine what is printed by the following code.

Answer:
18
Explanation:
a will get the values 3,6,9,12,15 and 18.
sum will get the values 0,3,9,18,30 and 45. When it gets to 45, the loop will not be executed anymore.
At that point, a is 18.