Question.7
A developer uses modulo to compute a circular buffer index:
int offset = -7; int size = 5; int idx = offset % size; printf("%d", idx);
What is the output?
Select Answer
3 — modulo always returns a positive result
-2 — the result follows the sign of the dividend
2
Undefined behavior — modulo of negative numbers is not allowed