16. Bitwise Operations-III

Question.6

Two developers check whether bit 5 is set in a configuration register:

Style A:

if (reg & (1 << 5)) {

Style B:

if ((reg >> 5) & 1) {

Which statement about these two styles is correct?

Need Help? Refer to the Quick Guide below

Select Answer

Restart quiz!