Question DSA-BIT-0066
HardWhat does x & (x − 1) == 0 test for x > 0?
- A.
Whether x is odd
- B.
Whether x is prime
- C.
Whether x is even
- D.
Whether x is a power of 2
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 x & (x − 1) == 0 test for x > 0?
Whether x is odd
Whether x is prime
Whether x is even
Whether x is a power of 2
Sign up free to see the answer and a step-by-step explanation.