0
Can anyone plzz tell me how to use the module operator here??
You are making a program for a bus service. A bus can transport 50 passengers at once. Given the number of passengers waiting in the bus station as input, you need to calculate and output how many empty seats the last bus will have. Sample Input: 126 Sample Output: 24
30 odpowiedzi
+ 4
Aayush Singh Thakur Read this lesson :
https://www.sololearn.com/learn/CPlusPlus/1609/?ref=app
+ 3
You need to get the remainder of input divided by 50 by the '%' operator. Then substract the remainder from 50 and you will get the answer.
+ 3
The answer is 6
+ 2
Do you want the answer of this question?
+ 1
input % maxPassengers
The result is the remsinder after input is divided by maxPassengers
226%50 will result in 24