Answer and explanation

Correct answer: B. `8`

  1. Step 1: Convert decimal numbers to binary: and .
  2. Step 2: Apply the bitwise AND (`&`) operation where both bits must be 1: 1100_2 \text{ & } 1010_2 = 1000_2. Convert to decimal: .
Answer
`8`.
Why not the others: '`14`' is the bitwise OR (`12 | 10 = 1110_2 = 14`); '`10`' is one of the operands; '`2`' is the bitwise XOR masked.

Practise more Python Programming, Data Structures, Algorithms, Networks and Cybersecurity.

Free questions with an explanation for every one, and full timed Saudi Secondary School Certificate mock tests.