gauriiighadge / HactoberFest2023

HactoberFest2023
https://github.com/gauriiighadge/HactoberFest2023
MIT License
21 stars 385 forks source link

Even_or_Odd_Bitwise.cpp #261

Open ADARSH-863 opened 1 year ago

ADARSH-863 commented 1 year ago

This C++ program uses bitwise AND operator to quickly determine if a given number is even or odd. By performing a bitwise AND operation between the input number and 1, the program checks the least significant bit. If the result is 0, the number is even; if it's 1, the number is odd. This bitwise operation efficiently detects the parity of the number, providing a concise way to identify its even or odd status.