0

# Explain Modulo

I want to know what is modulo. its says it's a %. but it doesn't act like a %. i need to understand the math of it too. can u explain it for me. that will really help me.

4 Answers

+ 2

It is the rest from division. For example:
14 % 3 = 2 because 14 / 3 = 4 * 3 + 2
5 % 2 = 1 because 5 / 2 = 2 * 2 + 1

+ 1

The remainder of 10 when divided by 3 is 1. So, 10 % 3 = 1
This explains that the modulus is actually just the reminder of some division.

+ 1

Euclid division

0

so then when i using a modulo in the code which one will be the result. here is a math like-
200X26% = 52
when i will do it in the code it will show me the result 52. right..