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?
Select Answer
Only Style A works — Style B always returns 0 or 1, breaking the check
Only Style B works — Style A returns the bit's weight (32), not 1
Both work for the if-check, but they return different non-zero values when the bit is set
Both work and return identical values