Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
Hi. Modulus shouldn't be different in any programming language. The syntax on how to get Modulus (or mod) might be different, but that is easy to figure. Basically mod is returning the remainder of an integer division. In case 10 / 5 (pure division notation) the result is 2 and nothing remains. 10 % 5 (Modulus notation) is 0 because nothing is remaining. 10 % 3 would be 1. Integer division (10 / 3) would return 3 (float division 3.3333...). Reason is that 3 fits three times into 10, 3*3=9 and there is 1 remaining to fill up to 10, which is the result of a Modulus operation. Hope this helps. Cheers. C.
23rd Jul 2019, 8:42 PM
ChrA
ChrA - avatar