+ 1
Why is division a different function than modulus? Do they not preform the same function?
5 Answers
+ 3
Because division / show the Quotient and the % shows us reminder.
Ex. 2/2 = 1
2%2=0
It shows different values That's why we can not use same function. I hope you understand.
+ 3
If I have 7 cookies and 2 kids, how many complete cookies will each kid get?
7/2 == 3
(Decimals are ignored.)
And how many cookies will be left over?
7%2 == 1
+ 2
Modulus is for Remainder,
Division is for, Division.
+ 1
Why?
This function is very useful for mathematical calculations. For example, a decimal number can be converted into a binary number using the modulo division. This is a good task for code practice in any program language. I recommend solving that.
+ 1
Their roles are different. One gives remainder while the other gives quotient of division.