0
I not understand with %
5 Antworten
+ 2
is the remainder of the operation, for example 100%10 results 0 because 100/10 = 10 and there is not remainder, another example is 5%2 the result is 1 because 5/2 = 2 and the remainder is 1
+ 2
Modulus is remainder value after the closest division. In case of 38 modulus 5. The closest we can go is 35(5 times 7). The remaining number is modulus. Three in this case. 38-35 equals 3. Hope this helps.
+ 1
The modulus operator is very different from division. it does divide, but that number is discarded, whatever is left is printed. in the example of 25%7 we get this;
25/7 does not give a whole number, 21/7 is the closest since we cant increase the starting value of 25. this results in 3, but is discarded. 25-21 is all that matters here, and the answer to that is 4.
this can be used to calculate for example; the number of leftover days in a year when you divide the days in a year (365) by the number of weeks in a year (52). 365%52 becomes 364/52 to make the result a whole number. 365-364=1, in this case 1 is printed. Hope this helps:)
0
% is mod. if 100%10 then ans o bcz reminder is ntg .
0
jerk it man