15. Bitwise Operations-II

Question.4

A developer checks if bit 3 is set in a status register. The register currently holds 0x0E. He writes:

if (status & 1 << 3) {
   printf("Set");
} else {
   printf("Clear");
}

Will this code produce the correct result?

Need Help? Refer to the Quick Guide below

Select Answer

Restart quiz!