Transportation quiz | Sololearn: Learn to code for FREE!

+1

Transportation quiz

I have no idea how to write the answer in the c++ language

c++

4/12/2021 2:30:07 PM

J A M E S

2 Answers

New Answer

+1

Try to understand this: #include <iostream> using namespace std; int main() { //your code goes here int waitingpassangers; cin >> waitingpassangers; int buscapacity = 50; int peopleinthelastbus = waitingpassangers % buscapacity; int emptyseats = 50 - peopleinthelastbus; cout << emptyseats; return 0; }

-2

J A M E S Just learn lessons again and see the Explanation given in problem. You will get solution. Hint :- Use Modulus Operator ( % ) to get solution