Question.7
A firmware engineer wants to set bits 1, 3, and 5 simultaneously in a GPIO data register. Which expression achieves this correctly and safely?
Select Answer
reg |= (1 << 1) | (1 << 3) | (1 << 5);
reg |= (1 << 1) & (1 << 3) & (1 << 5);
reg |= (1 << 1) + (1 << 3) + (1 << 5);
Both A and C produce the same result
All three (A, B, and C) produce the same result