i can't understand modulus (%) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

i can't understand modulus (%)

26th Aug 2016, 12:12 AM
oussama marshall
oussama marshall - avatar
4 Answers
+ 3
Modulus is showing the remainder of division. it is used in many languages like C, C#......
26th Aug 2016, 3:35 AM
Hedayatullah Sarwary
Hedayatullah Sarwary - avatar
+ 2
it is a symbol used in format specifier ex: int - %d float - %f char - %c or %s it is also used for modulo division. which prints remainder when we divide two numbers ex: 5÷2 = 2.5 5%2 = 1
26th Aug 2016, 1:10 AM
Jujagiri Hemanth
Jujagiri Hemanth - avatar
0
oooow thank you very much!!!!!, so the remainder is the important thing!!!! i got it
26th Aug 2016, 1:17 AM
oussama marshall
oussama marshall - avatar
0
Modulus is showing the remainder of division, in lot of languages modulus is used like php, c#, c and c++: Ex: if we want to take modulus of 23 divided by 3 its 2 23%3 = 2 3 × 7 = 21 21 + 2 = 23 Now modulus of 23 is 2
16th Sep 2019, 2:17 PM
Hedayatullah Sarwary
Hedayatullah Sarwary - avatar