0
How does print(17%3) equals 2?
Sorry guys I'm too dumb to understand this... :/
15 ответов
+ 6
Hi!
You can think like this:
the multiplication table for 3 gives: 0, 3, 6, 9, 12, 15, 18, ...
So to get 1, 4, 7, 10, 13, 16, 19,... from that table you have to add +1;
And to get 2, 5, 8, 11, 14, 17, 20, ... you have to add +2 to that table.
=> 17 = 15 + 2
=> 17 = (5 *) 3 + 2
=> 17 % 3 == 2
/Regards Per B🙂
+ 9
You just have to print your function & it will give you output of 2.
Likewise:
print(17%3)
% modulo operator will give you remainder after dividing it by 17%3
+ 7
You're not dumb at all! a dumb is one who doesn't understand and yet doesn't try anything to understand. Asking a question means you still got curiosity, a dumb just don't have it, and don't even care about it.
+ 1
17-15 = 2 so 2 is the modulo in this operation 17%3 ==>5*3+2
+ 1
Thanks! both of ya'll
+ 1
3)17(5
15
2
% value is remainder
So,17%3 is 2
+ 1
When you divide it with a normal division sign there will be the remainder so the remainder is the answer
0
Thank you very much!
0
it is what is left when you perform integer division 17/3. Cause 3*5 is the closest u get to 17, then the remainder is 2
0
3)17(5
15
2
% value is currect
So,17%3 is 2 & this is the best way
0
Yes
0
2
0
Mrglierifr ztb in the wali we iqugchhugu