- 2

Explain it to me please.

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 Explanation: The first bus will transport 50 passengers, leaving 126-50=76 in the station. The next one will leave 26 in the station, thus, the last bus will take all of the 26 passengers, having 50-26=24 seats left empty.

27th Jan 2021, 1:41 AM
â€ïžđŸ˜PreranađŸ˜â€ïž
â€ïžđŸ˜PreranađŸ˜â€ïž - avatar
4 RĂ©ponses
+ 5
Tip: you can use the modulo operator (%)
27th Jan 2021, 2:23 AM
Sonic
Sonic - avatar
+ 4
Please show us your attempts. QnA is not made for asking for others' solutions. Review your lessons, then show is your code that causes bugs (if any) . Thanks. Hope you understand.
27th Jan 2021, 1:48 AM
noteve
noteve - avatar
+ 3
Sathe Prerana Satish I think explanation is already given with every problem. So no need of further explanation. You just have to show your attempts if getting problem.
27th Jan 2021, 4:19 AM
AÍąJ
AÍąJ - avatar
+ 1
Ok thanks👍
27th Jan 2021, 7:18 AM
â€ïžđŸ˜PreranađŸ˜â€ïž
â€ïžđŸ˜PreranađŸ˜â€ïž - avatar