0

someone help me with this

a bus can carry 50 passengers at a time. Given the number of passengers waiting at the bus station as input, you have to calculate and generate how many empty seats the last bus will have. Input example: 126 Output example: 24 Explanation: The first bus will carry 50 passengers, leaving 126-50 = 76 at the station. The next one will drop 26 at the station, so the last bus will carry all 26 passengers, having 50-26 = 24 empty seats.

14th May 2021, 8:57 PM
AD B
2 Answers
+ 1
Use modulus operator %.
14th May 2021, 9:26 PM
Haider Ittefaq
Haider Ittefaq - avatar
- 1
AD B Where is your attempts?
15th May 2021, 5:37 AM
A͢J
A͢J - avatar