Question DSA-BIT-0070
HardHow do you get the value of the lowest set bit of n?
- A.
n | (n − 1)
- B.
n >> 1
- C.
n ^ n
- D.
n & −n
Sign up free to see the answer and a step-by-step explanation.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Bit Manipulation question
How do you get the value of the lowest set bit of n?
n | (n − 1)
n >> 1
n ^ n
n & −n
Sign up free to see the answer and a step-by-step explanation.