← BYTES
C·Starter·Ref: 7.1.15

What does the modulo operator % return for two integers, e.g. 7 % 3?

Have a question about this video? Mention reference 7.1.15 when you contact us.

a.The quotient (2)
b.Always 0
c.The sum (10)
d.The remainder after integer division (1)
% yields the remainder of integer division -- 7 % 3 is 1, since 7 = 2*3 + 1. It's commonly used to test divisibility (x % n == 0) or to wrap a value into a fixed range.

Find this on YouTube & Instagram

Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:

#BYTES#BYTES7115#C