Question DSA-BIT-0071
HardHow do you turn off the rightmost set bit of n?
- A.
n | (n + 1)
- B.
~n
- C.
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 turn off the rightmost set bit of n?
n | (n + 1)
~n
Sign up free to see the answer and a step-by-step explanation.
n & (n − 1)
n ^ (n + 1)