+ 2
Can someone explain what is modulos operator?
6 Antworten
0
The % stands for modulo.
It's the remainder of a division.
First we divide our numbers 10/3. This gives us 3.3333333... Now this was from dividing. If we add modulo, 10%3 we get 1.
What we want is an interger from our division. 9/3 gives 3, 9%3 = 0.
10-9 = 1. 10%3 = 1.
10/3 does not work to get an interger, but 9/3 does. So
10-9 = 1
10%3 =1
Hopefully this explained what you wanted.
0
if / gets the QUOTIENT.
then % gets the REMAINDER.
0
This question has been answered over and over an over again, please search befor asking questions, there is even an answer in the topics comments
0
modules operator gives you remainder not else.
0
gg
0
sa