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
Answers
Answered by
4
Explanation:
Mark me as branilist
hope this helps
Answered by
0
Answer:
Modulos operator basically represents the leftover from the division
so what we need to do is take the number of people that will remain in the last bus travel which is stop % bus and compute bus - (stop % bus)
that way we know the number of empty seats on the last travel
This is like each bus was filled to the fullest (50 people per bus) what will remain is 26 and so on the last bus the number of empty seats will be 50 - 26 = 24
PS: 12 doesn't seem to be the right output of 126 % 50 it should be 26
Similar questions