Question.6
A developer computes the average of two uint8_t ADC readings:
uint8_t
uint8_t a = 200, b = 180; uint8_t avg = (a + b) / 2; printf("%u", avg);
What is the output?
Select Answer
190 — correct average
62 — because (a + b) wraps to 124 before dividing
190 — because a + b is promoted to int before dividing
Undefined behavior — unsigned overflow in addition