Question.2
A developer calculates a PWM duty cycle percentage:
uint8_t on_time = 3; uint8_t period = 10; uint8_t duty = (on_time / period) * 100; printf("%u%%", duty);
Expected output: 30%. What does it actually print?
Select Answer
30%
0% — because 3 / 10 = 0 in integer division, and 0 * 100 = 0
33%
Compilation error — % is not a valid format specifier