I solved it but I'm confused :(
Why (a%2 == 0) is true for "Negative and even" ?!
Why we don't write (a%2 != 0) ?
Шарох
Level 10
Hi Coders!
Resolved
Comments (2)
- Popular
- New
- Old
You must be signed in to leave a comment
Misiu
13 October 2020, 13:10
-7 / 2 = -3 and reminder is -1
-8 / 2 = -4 and reminder is 0, so
-8 % 2 = 0
+2
Шарох
14 October 2020, 05:29
Thank you Misiu :)
0