[Solved] Does 0 % 2 == 0?


Short explanation

(and no other letter)

0 is less than or equal to 0 so A will be printed.

Longer explanation (in case the short one was unclear to you)

There are three conditions being checked:

A. num <= 0

B. num >= 10

C. num % 2 == 0 (i.e. num is an even integer in plain English)

If you run 0 through those three conditions you’ll see that it meets the criteria for both A. and C., so both A. and C. would be printed.

The question wants numbers that cause C. (and not A. or B.) to be printed. Therefore any set containing 0 would not satisfy the question, even though, yes, 0 is an even integer.

solved Does 0 % 2 == 0?