I don't get the idea of modulo. I just can't understand what should I do or what is the mathematical calculation behind it. THX

Replace this line with your code.


When you divide a number.

say if X is divided by Y,

You get two things.

X / Y -- > Quotient say Q


X % Y --> Remainder say R

modulo is used to find this R,It means It gives you remainder not quotient.


13 / 5 -- > gives you Quotient 2.
13 % 5 --> gives you Remainder 3.

for more..


Thanks for this useful information and clear my all doubt the modulo.


the examples provided makes sense to me however in my exercise in Modulo it asked to get to 2. the used this as my example 16 % 7. Wouldn't that come to 2? 7 can go into 16 two times and there would be 2 left over, right?


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.