Even Odd (Bitwise Operations)

You are given an integer N.

Determine Output whether the number is Even or Odd using conditional statements.

Print:

  • "Even" if the number is divisible by 2
  • "Odd" otherwise

Example 1:

Input: N = 4

Output: Even

Explanation:

The least significant bit of 4 is 0.

Example 2:

Input: N = 7

Output: Even

Explanation:

The least significant bit of 7 is 1.

Now Your Turn!

Pick the correct output for the given input

Input: N = 10

Still unsure what the problem is asking ?

Let’s go through a few more examples, step by step, to make it clearer.

Constraints:

  • -100 <= N <= 100

Hints

Frequently Occurring Doubts

0
class Solution{
public:
void evenOddBit(int N){
//your code goes here
}
};
Test Case

Input:

N