38. Bitwise Rotation and Counting-I

Question.4

A developer writes a generic 8-bit left rotation function:

uint8_t rotate_left(uint8_t val, uint8_t n) {
   return (val << n) | (val >> (8 - n));
}

A caller passes n = 9. What happens?

Need Help? Refer to the Quick Guide below

Select Answer