Question DSA-BIT-0009
MediumWhat is the output of this code?
n, c = 13, 0
while n:
n &= n - 1
c += 1
print(c)
- A.
3
- B.
4
- C.
1
- D.
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 is the output of this code?
n, c = 13, 0
while n:
n &= n - 1
c += 1
print(c)
3
4
1
2
Sign up free to see the answer and a step-by-step explanation.