Link to home
Start Free TrialLog in
Avatar of mcuevas
mcuevas

asked on

Checking for even or odd number.

Is there a quick way to check if a number is even or odd?
ASKER CERTIFIED SOLUTION
Avatar of ildc
ildc
Flag of Belgium image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It should be

number mod 2 = 0   ' for even
number mod 2 = 1   ' for odd
Avatar of Gunsen
Gunsen

or bitwise
Even = (YourNumber AND 1)=0
Avatar of mcuevas

ASKER

that's what I was looking for, thanks.