0

Please help me understand

How does this question work X=3 Num=17 Print(num%x) The answer is 2 How??

2nd Nov 2019, 9:50 AM
LéMar
LéMar  - avatar
4 odpowiedzi
+ 3
LéMar, modulo operator "%" gives the remainder of the division. So 5*3 =15 and the remainder is 17-15 = 2. Hope now it's clear 🐱
2nd Nov 2019, 9:53 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
+ 1
What is the remainder of 17/3? So % operator gives you the remainder.
2nd Nov 2019, 9:55 AM
Avinesh
Avinesh - avatar
+ 1
You are welcome, LéMar 🐱
2nd Nov 2019, 9:57 AM
TheWh¡teCat 🇧🇬
TheWh¡teCat 🇧🇬 - avatar
0
thank you it is very clear nou
2nd Nov 2019, 9:54 AM
LéMar
LéMar  - avatar