756. Check whether a Given Number is Even or Odd
Given a number n, check whether a given number is even or odd.
Return "even" if Even else "odd".
Example 1:
Input: n=5
Output: odd
Explanation: 5 is not divisible by 2.
Example 2:
Input: n=4
Output: even
Explanation: 4 is divisible by 2.
Now Your Turn!
Pick the correct output for the given inputInput: n=1
Still unsure what the problem is asking ?
Let’s go through a few more examples, step by step, to make it clearer.
Constraints:
- 0 <= n <= 109