+ 5
Why dis output come 2????
4 Réponses
+ 13
In case you didn't know, "%" is the modulo operator, which means that it takes the remainder of integer division.
2%7 is the remainder when 2 is divided by 7
2/7=0 R**2**
This 2 is the output.
+ 8
modulus operator returns remainder so when a%7 = 2%7 (where a=2) the remainder is became 2 because integer division 7 divide 2 return 0 so remainder 2 is return
if you do 7%a then 7%2=1 so 1 will be returned
+ 4
if numerator < denominator modulus operation returns numerator.
0
thnxxxxx all of u!!!!!!