DEV Community

OLOSUNDE AYOOLUWA
OLOSUNDE AYOOLUWA

Posted on

Check if a number is Even or Odd

This simply uses the and bitwise operator to check if a number is even or odd. The operator converts the number to a binary number and user the rightmost number. if the rightmost digit is one, the number is said to be odd. If the rightmost digit is Zero, the number is said to be even.

?signin=true

Top comments (0)