+ 6
what get returned when 4%6
10 ответов
+ 4
Remember that if the first number is smaller then the second in modulo case the answer will be the first number always..
+ 5
Ask yourself two questions:
1.) How often does the 6 fit into the 4?
2.) And after that: How much will be left over?
+ 4
is it that you return 4 or how does it work
+ 4
it will return 4
calculation :
4 % 6 means
6) 4 (0 (QUOTIENT)
- 0
====
4 (REMAINDER)
since the modulus operator returns remainder
the result is 4
+ 3
The modulus operator returns the numerator if it is less than denominator!
+ 3
Yeah... The % symbol is a binary connector that returns the remainder of the dividion...
When:
4%6: we have no whole number quotient, but the remainder is 4
It returns 4
+ 3
Since 6 can't divide 4,the result would be zero remainder four.
Therefore 4%6 = 4 (the remainder)
+ 2
The return is 4
0
As the % is a Modules Operator.
When ever we take a modules of two operands. As
(Operand_1) % (Operand_2)
If the Operand_1 is higher
then
the Operand_2 then
it will divide the Operand_1
with
Operand_2
and will return the Remainder
but
if the Operand_1
is smaller then the
Operand_2 then it will
simply return back the Operand_1!
as in your case 4 is smaller then 6 so its answer will be 4%6 and it will return you back 4