Even or Odd Checker
This problem is pretty simple once you notice the rule. In Even or Odd Checker, you are given one integer and need to decide which label matches it.
The main job is not to do a long calculation. You only need to check whether the number divides evenly by 2. If it does, print EVEN. If it does not, print ODD.
For example, if the input is 8, the answer is EVEN because 8 can be divided by 2 without a remainder. If the input is 7, the answer is ODD because dividing by 2 leaves something behind.
So the task is to test one number, decide whether it is even or odd, and return the matching word.
Example Input & Output
7 leaves a remainder of 1 when divided by 2.
8 can be divided by 2 without any remainder.
0 is treated as an even number.
Algorithm Flow

Solution Approach
A good way to solve this problem is to use the modulo operation. The idea is simple: divide the number by 2 and check the remainder.
The nice thing about this method is that it gives a direct answer right away. You do not need extra loops, arrays, or helper variables beyond the input itself.
Once we choose that method, the logic becomes very short. First, read the number into a variable like n.
Next, check this condition:
If that condition is true, the number is even, so the output should be EVEN.
If that condition is false, the number is odd, so the output should be ODD.
You can think of the solution as one decision point: remainder 0 means even, and any other remainder means odd. That is why this problem stays short and clear.
Best Answers
Solutions Coming Soon
Verified best solutions for this Challenge are still being analyzed and will be available soon.
Comments (0)
Join the Discussion
Share your thoughts, ask questions, or help others with this Challenge.
