Write a function bool isEven(int Number) which would check if input number is even or odd.
Solution:
The key to this question is to understand that first bit in all odd number would be always set to 1.
2021222324...
So, the solution is quite simple:
Solution:
The key to this question is to understand that first bit in all odd number would be always set to 1.
2021222324...
So, the solution is quite simple:
bool isEven(int Number)
{
return (Number & 1) == 0;
}