Multiple choice

11 ^ 5 What is the output of the above operation?

  1. 1

  2. 6

  3. 8

  4. 14

  5. 15

Reveal answer Fill a bubble to check yourself
D Correct answer
Explanation

The ^ operator is bitwise XOR in C. 11 in binary is 1011, 5 is 0101. XOR compares each bit position: 1^0=1, 0^1=1, 1^0=1, 1^1=0. Result: 1110 which is 14 in decimal. XOR gives 1 only when bits differ.