Please this code is not working how do I make it work ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Please this code is not working how do I make it work ?

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. https://code.sololearn.com/cAITpcJFcoDw/?ref=app https://code.sololearn.com/cAITpcJFcoDw/?ref=app

15th Mar 2023, 7:47 PM
Oluwatobi Prosper
2 Answers
+ 2
C++ isn't my strongest suit, but I'll say my recommendation here. You're trying to combine too many operations at once. Declare your variables, then take your inputs, then do the math, then print it to the screen. I think it will help if you look at each of these as different tasks
15th Mar 2023, 9:26 PM
Bob
+ 3
Eh, for starters, there is a comma before the semicolon in line 7. Also you are using variables like `Input` before you initialize them. Maybe you can start there.
15th Mar 2023, 9:08 PM
cacgs