+ 1
Hi guys! Can you tell me please how the operator % work?
Logical operator
2 Respuestas
+ 1
It count the rest of the division, we are operating on natural numbers so the result must be >=0
for example 5 % 2 = 1
because:
5 - 2 = 3 rest: 0
3 - 2 = 1 rest: 0
1 - 2 = 0 rest: 1
because 2 is greater than 1