Even or Odd (Ternary)
Easyjava
Read an integer and print Even or Odd using the ternary operator.
Input: one integer.
Output: one line — Even or Odd.
Example 1
Input
4
Output
Even
Example 2
Input
7
Output
Odd
- -1000000000 <= n <= 1000000000
Hint 1
n % 2 == 0 tests for even.
Hint 2
Negative even numbers also give remainder 0.
n % 2 == 0 is the condition; the ternary returns "Even" when it holds and "Odd" otherwise. Zero is even, and the sign does not matter.