+ 4
in such cases, the answer is the smaller number itself. Because larger number times 0 can only be less than the smaller number, remainder is the smaller number itself
22nd Mar 2017, 9:54 AM
Meharban Singh
Meharban Singh - avatar
+ 2
@Srinivasa 3/6 = 0.5 then the remainder is 0, but: 3//6 = 0 3%6 = 3 Modulus operator is based on floor division (the second one).
22nd Mar 2017, 8:40 AM
Xavier Alonso
Xavier Alonso - avatar
- 1
Try to divide 3 / 6. What is the quotient and what is the remainder? The answer to your question is the remainder, as "%" is the operator for the remainder operation.
22nd Mar 2017, 7:35 AM
Álvaro