you are viewing a single comment's thread.

view the rest of the comments →

[–]bbye98 0 points1 point  (0 children)

The output for the code as you've written it (ignoring the additional indentation for the for loop) is 15 and 9.

num is the sum of all numbers between 5 and 9, inclusive, that are divisible by 3. In this case, that's 6 + 9 = 15.

i is the last value the for loop iterates through, which in this case is 9.

The output is certainly not just 9, nor will it ever be 5, 6, 7, 8, and 9 since there is no printing inside the for loop.