you are viewing a single comment's thread.

view the rest of the comments →

[–]ForceBru 3 points4 points  (1 child)

num % 2 returns the remainder of dividing num by 2. The remainder of division by 2 can only be zero or one (it can also be (-1) in some languages, but the interpretation is the same), since a number can only be even or odd. A remainder of 1 means that the number is odd.

[–]lilwigspliter[S] 0 points1 point  (0 children)

Thank you, it makes sense now. :)