Know the answer | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Know the answer

>>> x=3 Num=17 Print(num%x)

4th Jul 2018, 9:51 PM
Kwame
Kwame  - avatar
4 ответов
+ 5
Depends on language, but a compile error is what I expect, since num is undefined. Print isn't likely defined either. Your best bet is to run this and see for yourself. If you have trouble understanding what happened, post a link to the code when asking for help.
4th Jul 2018, 11:45 PM
John Wells
John Wells - avatar
+ 5
17%3 finds the remainer. 3 goes into 17 5 times for 15. 17-15=2 so x=3 num=17 print(num%x) displays 2.
5th Jul 2018, 1:21 AM
John Wells
John Wells - avatar
+ 1
thank u
5th Jul 2018, 1:49 AM
Kwame
Kwame  - avatar