0

I need help guys! How to write its code?

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.

21st Apr 2022, 8:53 PM
Mouadh Bouziane
Mouadh Bouziane - avatar
4 Answers
+ 2
Where is your try?? what help you need here?
21st Apr 2022, 8:56 PM
Jayakrishna šŸ‡®šŸ‡³
+ 2
50 - 126%50 = 24 input: 126 => Each trip, 50 passenger can travel. On last trip 26 will travel so empty seats are 24
21st Apr 2022, 9:00 PM
Jayakrishna šŸ‡®šŸ‡³
0
126/50 = 2.5... Ceil(2.5..)=3 3*50-126 =24
21st Apr 2022, 8:57 PM
Oma Falk
Oma Falk - avatar
0
I couldn't figure it out šŸ˜„
21st Apr 2022, 8:57 PM
Mouadh Bouziane
Mouadh Bouziane - avatar