Question DSA-BIT-0029
EasyWhich expression gives 1 if bit k of n is set and 0 otherwise?
- A.
n | k
- B.
n ^ k
- 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
Which expression gives 1 if bit k of n is set and 0 otherwise?
n | k
n ^ k
Sign up free to see the answer and a step-by-step explanation.
n << k
(n >> k) & 1