How Modulo works? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How Modulo works?

Int x =8 y=5. Int result =x%y

25th Jan 2018, 5:53 AM
john
john - avatar
3 Answers
+ 5
Best way to think of it is to: Subtract y from x until x is smaller than y and what is left (the remainder) is stored in result.
25th Jan 2018, 6:04 AM
John Wells
John Wells - avatar
+ 1
Thank you
25th Jan 2018, 5:25 PM
john
john - avatar
0
This question was asked at least 100 times. Search for it before posting a new one.
25th Jan 2018, 6:33 AM
Lucien
Lucien - avatar