Question PSC-BIT-0002
EasyWhat will be the output of the following pseudocode?
Integer a = 12, b = 10
Print a & b
- A.
2
- B.
8
- C.
Show answer and explanation
Answer: B
12 = 1100 and 10 = 1010. AND keeps bits set in both: 1000 = 8.
Popular companies
Prepare company by company
Hiring pattern, syllabus, past questions and mocks for each company.
All companiesPractice by subject
Bitwise Operators question
What will be the output of the following pseudocode?
Integer a = 12, b = 10
Print a & b
2
8
Answer: B
12 = 1100 and 10 = 1010. AND keeps bits set in both: 1000 = 8.
6
14