+ 1

Can you help please

There are 2 class sections: the first section has 18 pupils, and the second one has 19. The total number of books available for distribution is 76. Write a program to calculate and output how many books will be left after each student receives both books. With % operator . I know the answer but miss the why and how

28th Feb 2021, 1:35 PM
Norbert Makk
Norbert Makk - avatar
6 Answers
+ 1
rest=76%(2*(18+19))
28th Feb 2021, 1:45 PM
JaScript
JaScript - avatar
+ 1
Next time please show or better provide link to your attempt on SL Playground. Happy coding.
28th Feb 2021, 1:48 PM
JaScript
JaScript - avatar
0
Thank you
28th Feb 2021, 1:46 PM
Norbert Makk
Norbert Makk - avatar
0
Do you mean each student get two book by "after each student recieves both book".
28th Feb 2021, 1:47 PM
Sonam Tashi
0
Yes
28th Feb 2021, 1:47 PM
Norbert Makk
Norbert Makk - avatar
0
Here one more example >>> total_book = 76 student = 37 # 18 + 19 left_book = 76 % (37*2) print(left_book)
28th Feb 2021, 1:52 PM
Sonam Tashi