Help!! This is transportation exercise from c++ course. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Help!! This is transportation exercise from c++ course.

#include <iostream> using namespace std; int main() { //your code goes here int no.of passengers = {}; cin >> no.of passengers %50; return 0; }

6th Dec 2020, 6:49 AM
Otaku Gamer
Otaku Gamer - avatar
6 Answers
+ 5
Otaku Gamer Am not sure what you asking.. try to explain it! Sameer Don't give the user exact solution! Even if you are helping him then try to explain it
6th Dec 2020, 10:06 AM
Piyush
Piyush - avatar
+ 2
Otaku Gamer the challenge asks for the empty seats, not the occupied seats. You can't use space or special characters in variable names. And put input and computation in different lines
6th Dec 2020, 7:57 AM
Benjamin Jürgens
Benjamin Jürgens - avatar
+ 2
A simple three lines of code implementation. First, you use the modulus function to find the remainder, which are the passengers on the last bus. Then, to find the empty seats, you use bus capacity minus away the last passengers. https://code.sololearn.com/cAsIKRZH3quK/?ref=app
16th Dec 2020, 12:45 PM
Lam Wei Li
Lam Wei Li - avatar
+ 1
Otaku Gamer Well excercises are given to learn coding and build logic but if you ask for help without doing anything then you can't learn. So I will suggest if you want to learn then try self.
6th Dec 2020, 7:17 AM
A͢J
A͢J - avatar
0
Just write this Int x; cin>>x; cout<<50-x%50; done
9th Apr 2021, 3:42 AM
Rahfi
Rahfi - avatar
- 2
Sameer you shouldn't give out complete codes, that has very little learning effect And your code isn't even correct
6th Dec 2020, 7:50 AM
Benjamin Jürgens
Benjamin Jürgens - avatar