Can any one show me the the working of modolus operator ?? why why 4 % 7 =4 ?? | Sololearn: Learn to code for FREE!

+4

Can any one show me the the working of modolus operator ?? why why 4 % 7 =4 ??

it is easy to find the 5%1, 9%4 where first number is larger than second number but reverse i can not get it

mod

7/14/2017 7:32:07 AM

Dhananjay Kumar

4 Answers

New Answer

+19

Think about it this way... how many times can 7 go into 4 evenly? 0, which is your quotient. But we have a remainder of 4, the solution to the modulus problem. Happy coding!

0

0

-2

For example when you division of 5 and 2 result is 2.5 but as decimal result is 2 and remaining is 1