+ 1
Can someone enlighten me, what is modulus?
8 Antworten
+ 5
returns the remainder when divided:
10%3 = 1
12%4 = 0
23%5= 3
etc
+ 1
the modules operator(%) is most often been confused with the division
(/) operator
(%) operator returns the remainder when divided
7%2=1
whereas
(/) operator returns the quotient when divided
7%2=3
+ 1
See my "% Modulus explained" code to understand in a way, you may have learnt at school
https://code.sololearn.com/c2fRl6x893E7/?ref=app
+ 1
Thanks
0
modulus returns us the remainder
14%4= 2
0
%
0
Tank You for explanation!
0
nice. very good ans