gauriiighadge / HactoberFest2023

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

Even_or_Odd_Bitwise.cpp #261

Open ADARSH-863 opened 8 months ago

ADARSH-863 commented 8 months 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.