127. Arithmetic Edge Cases-I

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?

Need Help? Refer to the Quick Guide below

Select Answer