Even or Odd — Solution & Editorial
Check N % 2 == 0. Note the magnitude: use a 64-bit type in C/C++/Java. In Python integers are unbounded so int(input()) % 2 just works (Python's % on negatives still returns 0 for even numbers).
Check N % 2 == 0. Note the magnitude: use a 64-bit type in C/C++/Java. In Python integers are unbounded so int(input()) % 2 just works (Python's % on negatives still returns 0 for even numbers).