Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Determine if a Number is Odd or Even using Bit Manipulation #1045

Closed
2 tasks
Kamini8707 opened this issue Oct 19, 2024 · 2 comments
Closed
2 tasks

Determine if a Number is Odd or Even using Bit Manipulation #1045

Kamini8707 opened this issue Oct 19, 2024 · 2 comments

Comments

@Kamini8707
Copy link
Contributor

Description:
I would like to add a new feature to the repository: a program to determine if a given number is odd or even using bitwise operations. Instead of using the traditional modulus operator, this program will utilize the bitwise AND operator to perform the check in a more efficient manner.

Feature Details:
The program will take an integer input and check the least significant bit (LSB) using the bitwise AND operator (&).
If the LSB is 1, the number is odd; if it's 0, the number is even.
The time complexity of this solution is O(1), making it a highly efficient approach.

Labels:
new algorithm, gssoc-ext, hacktoberfest, level1


Assignees:

  • Contributor in GSSoC-ext
  • Want to work on it
Copy link

👋 Thank you for raising an issue! We appreciate your effort in helping us improve. Our team will review it shortly. Stay tuned!

@pankaj-bind
Copy link
Collaborator

@Kamini8707 assigned

pankaj-bind added a commit that referenced this issue Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants