ProgrammingModerate

What is the value of 0x80 | 0x01 | 0x10 in decimal?

  1. A. 146
  2. B. 144
  3. C. 17
  4. D. 145

Correct answer: D. 145

0x80 is 128, 0x01 is 1 and 0x10 is 16, so the OR is 145. The bits do not overlap, so OR and addition agree.

More C Programming questions

Exams that ask this topic