+ 1

[DUPLICATE] Can someone explain the modulus operator and its working ?

need help understanding.

22nd Mar 2018, 10:57 AM
Ashish
Ashish - avatar
6 Answers
+ 12
Check the following posts first..If you still don't understand, feel free to ask me https://www.sololearn.com/discuss/270744/?ref=app https://www.sololearn.com/discuss/408503/?ref=app
22nd Mar 2018, 11:23 AM
Nikhil
Nikhil - avatar
+ 6
Modulus operator returns the reminder after dividing the first number with the second one. If the first number is smaller than the second, then the quotient will be zero while the remainder will be the first number itself. If both the numbers are perfectly divisible, remainder will be zero.
22nd Mar 2018, 11:29 AM
Baraa AB
Baraa AB - avatar
+ 5
Modulus operators:::::: % it returns the reminder Eg. 3%2=1.. because 1*2 = 2 ...reminder will be 1 which is returned by the modulo operator.. Working:::: Usually it is used for retrieving the last no...by using %with 10, 100, ... Eg. 123 % 10 = 3.....because 12 _____ 10 |123 120 ------- 003 ------- thus the last no of 123 is retrieved
22nd Mar 2018, 12:38 PM
Shivadharshini Nagaraju
Shivadharshini Nagaraju - avatar
+ 2
If we divide 1.25 by 2 than, we can write: 1.25= .5*2(here .5*2=1)+.25 (here .25 is remainder) hence, 1.25 divided by .5, quotient is 2 and .25 isn't divided by .5 so it is remainder. above term is expressed by modulus sign (%),where % shows only remainder,not shows quotient. it is expressed by 5%2 = 1 11%4 = 3 5%3 = 2 3%5 = 3 6%5 = 1 12%7 = 5 2%2 = 0 1.25%.5 = .25
22nd Mar 2018, 11:36 AM
📈SmileGoodHope📈
📈SmileGoodHope📈 - avatar
+ 1
●5 / 5 is 1 it gives the quotient but ● 5%5 is 0 it gives the remainder ■ 10/3 ==> 3 (quotient) ■ 10%3 ==> 1 (remainder)
22nd Mar 2018, 11:27 AM
I'm_Groot
I'm_Groot - avatar
0
it is used for returning the remainder. for example if you divide 15 by 2 then remainder is 1. we use percentage sign % for returning remainder
23rd Mar 2018, 3:57 PM
Vibhu Sharma
Vibhu Sharma - avatar