DEV Community

OLOSUNDE AYOOLUWA
OLOSUNDE AYOOLUWA

Posted on

2

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)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay