ProgrammingModerate

printf("%d", 0x80 >> 7); What is printed?

  1. A. 128
  2. B. 1
  3. C. 0
  4. D. 7

Correct answer: B. 1

Shifting 0x80 right by seven places leaves the top bit in bit 0, which is 1.

More C Programming questions

Exams that ask this topic