38. Bitwise Rotation and Counting-I

Question.5

An interrupt controller's 8-bit pending register reads 0xB6. A developer counts how many interrupts are pending:

int count = 0;
while (val) {
   count += (val & 1);
   val >>= 1;
}

How many interrupts are pending?

Bit76543210
0xB610110110
Need Help? Refer to the Quick Guide below

Select Answer