Question DSA-BIT-0024
EasyWhat does n & (n − 1) do to an integer n?
- A.
It reverses the bits
- B.
It clears the lowest set bit of n
- C.
It doubles n
- D.
It sets every bit of 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
What does n & (n − 1) do to an integer n?
It reverses the bits
It clears the lowest set bit of n
It doubles n
It sets every bit of n
Sign up free to see the answer and a step-by-step explanation.