29. Bit Field Operations-ii

Question.2

A developer wants to swap the upper and lower nibbles of an 8-bit register. The register currently holds 0xA7. He writes:

uint8_t result = (reg << 4) | (reg >> 4);

Will this produce the correct result 0x7A?

Need Help? Refer to the Quick Guide below

Select Answer