explain me please the modulus | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

explain me please the modulus

it's bery difficult for me.for example 14℅3?

23rd Aug 2017, 6:28 AM
caida dodosy
caida dodosy - avatar
3 Answers
+ 4
The modulo (%) opeator allows you to determine the remainder when the number get divided by another number. For example, 14 % 3 = 2 as 14 = 4 × 3 + 2 In this case, we know there are *4* 3s inside the number 14 with a remainder of 2. It's always helpful if you express the modulo (a % b = ?) in this form:- a = n × b +✨?✨ where n is the multiplier and ? is the solution for modulo. More examples:- 0 % 3 = 0 (0 = 0 × 3 + 0) 1 % 3 = 1 (1 = 0 × 3 + 1) 2 % 3 = 2 (2 = 0 × 3 + 2) 3 % 3 = 0 (3 = 1 × 3 + 0) 4 % 3 = 1 (4 = 1 × 3 + 1) 5 % 3 = 2 (5 = 1 × 3 + 2) ... and so on.
23rd Aug 2017, 6:52 AM
Zephyr Koo
Zephyr Koo - avatar
+ 2
thak you very much. now i understand
24th Aug 2017, 3:06 PM
caida dodosy
caida dodosy - avatar