I don't understand how does % works? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 3

I don't understand how does % works?

how 38%5 is 3. can someone explain to me in the most plain English. have no idea why I don't get it. I know that weird situation but pls

28th Apr 2016, 11:15 AM
Rafal Misko
Rafal Misko - avatar
22 Answers
+ 14
Modulus is remainder value after the closest division. In case of 38 modulus 5. The closest we can go is 35(5 times 7). The remaining number is modulus. Three in this case. 38-35 equals 3. Hope this helps.
12th Oct 2015, 10:43 PM
Tarun
+ 5
38%5 = 5+5+5+5+5+5+5+(3) 12%5 = 5+5+(2)
17th Jan 2016, 6:40 PM
Ildar Zakirov
Ildar Zakirov - avatar
+ 2
it's simple division Guyz...it must not be complicated---The 38 is not divisible by 5. the closest we can divide 38 by 5 is 7 times (35) and the Rest remaining digits (38-35) which is the Remainder is your Modulus.
16th Jul 2016, 5:14 AM
Krutarth Makwana
Krutarth Makwana - avatar
+ 2
% works for getting remember of division.
24th Oct 2016, 8:12 AM
Bibek K. Sah
Bibek K. Sah - avatar
+ 1
yeah i still find that confusing
11th Jun 2016, 6:55 AM
Obaidullah Khalid Buksh
Obaidullah Khalid Buksh - avatar
+ 1
simply ℅ gives remainder as 35%5 here remainder is 0 and quotient is 5. and in ur eg.. 38%5 here remainder is 3 and quotient is 5
19th Jul 2016, 12:49 PM
Jeevan Pokhrel
Jeevan Pokhrel - avatar
+ 1
what if modulus like this : 4%5?
6th Sep 2016, 10:34 AM
Konstantin
Konstantin - avatar
0
Well I guess it's the remainder of a division statement. For example if you do 9 % 2 since 9 divided by 2 is 8 r1, 9 % 2 = 1
8th Dec 2015, 8:37 PM
Samuel Hernandez
Samuel Hernandez - avatar
0
38:5=7*5+3 38%5=3
23rd Dec 2015, 4:32 AM
Хачатур Карапетян
Хачатур Карапетян - avatar
0
how many yin can you divide 5 into 38? 7 times. that's makes 35. 38 - 35 = 3. therefore the remainder is 3.
11th Jan 2016, 9:10 PM
Chris Titmus
0
you can division 38/5 that is 7 time write left 3. this 3 is a module. example: 5*7=35and then +3=38 I think u understand
23rd Mar 2016, 5:59 AM
khalil
khalil - avatar
0
also if you want to find x%y=z the number z is smaller than y do it yourself and you can learn easily..:)
9th Jun 2016, 5:47 AM
özgür
özgür - avatar
0
5x7=35 38-35=3 modulo = 3
9th Jun 2016, 12:29 PM
Marcelo Canales
Marcelo Canales - avatar
0
as expalined above % is modulo operator, ot simply returns the reminder of the division. u can use the same for even odd test if(num%2==0)// it checks if number is completely divisible by 2 alert("Even"); else alert("Odd");
12th Jun 2016, 2:39 AM
Avdhoot yadav
Avdhoot yadav - avatar
0
reminder the part of number remaine which output not int .. 13%5 -> 10/5 and 3/5 .. 10/5 = 2 int .. 3/5 wont be int .. so that 3 is reminder ..
22nd Jun 2016, 8:51 AM
Hosam Mohamed
Hosam Mohamed - avatar
0
Modulus(%) is remainder which is remaining number you get after dividing. Example: 38%5=3 as 35 is divided by 5 but remaining 3 is remainder. It is simple math which you should have read in 3rd grade..
10th Nov 2016, 3:20 PM
Namas Thapa
Namas Thapa - avatar
0
38 / 5 = 7 and the left over is = 3.
29th Nov 2016, 1:39 AM
Syed NomanulHasan
Syed NomanulHasan - avatar
0
38 / 5 = 7 5 * 7 = 35 38 - 35 = 3
29th Nov 2016, 1:42 AM
Syed NomanulHasan
Syed NomanulHasan - avatar
0
it's what you have left after you divide. say for instance 38÷5. 5 goes into 38 seven times stopping at 35. how much is left over from the 38? three.
29th Nov 2016, 9:05 PM
evan
evan - avatar
0
thanks everybody I've learned it
8th Dec 2016, 3:15 PM
Whisper in silence