0

7%2 explain

2nd Sep 2016, 7:29 AM
Jatin Habibkar
Jatin Habibkar - avatar
2 Answers
0
7%2 is 7 mod 2 , mod is operation finds the remainder after division example 7%2 , the result of division is 7/2 = 3 and the remainder is 1 so 7%2 = 1
2nd Sep 2016, 7:58 AM
beauty1234
0
% (modulo) means that you will have to find the remainder. It's floor division but with an extra step. 7%2 means that you will first see how many times two goes into seven. Two goes into seven three times. Two times three is six. Next, you subtract seven minus six. Your remainder will be one because it's what's left. That's how the % (modulo) works.
2nd Sep 2016, 11:57 AM
DELETED