Transportation C++ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson

Transportation C++

I just started coding C++ today, I found that while my code does work and gives the correct answer it says I’m not correct. #include <iostream> using namespace std; int main() { //your code goes here int pop = 126; int bus = 50; pop %= bus; cout << pop << endl; return 0; } And I end up with 26 or even if I change the pop it still finds the remainder so does anyone know of in doing the question incorrectly?

19th Apr 2022, 9:27 PM
Tankmaniac 19
1 Answer
You need to take input of number of passenger. Then find empty seats If input is 126 then 150-126=24 is empty seats.. as each trip filled with 50 passengers..
19th Apr 2022, 9:32 PM
Jayakrishna 🇮🇳