ProgrammingVery hard

An 8-bit value 0b10010110 is rotated left by 3 positions within 8 bits. What is the result in decimal?

  1. A. 150
  2. B. 75
  3. C. 45
  4. D. 180

Correct answer: D. 180

The rotate gives 10110100, which is 128 + 32 + 16 + 4 = 180. The bits shifted out at the top come back in at the bottom.

More C Programming questions

Exams that ask this topic