0
Pls explain to me what of means.
cout<< 50-(x%50) ;
8 ответов
+ 3
Kinan Alkadri 20%50 will give u result 20 if your numerator is greater than denominator then remainder will be output .
If numerator is less than denominator then output will be numerator
+ 2
Its error your x variable is undefined by the way % will give u remainder
+ 2
According to the problem declear some variables and do calculation its simple first try it self
+ 1
cout is a object which belong to using namespace std ; library which is use to print any values pf string this is output statement and here suppose if you defined any variable
Int x=20
and via
cout<<50-(x%50);
50-(20%50) bracket will give u result 20 so 50-20 will give result 30 read basics first u will understood much better
+ 1
Ok thank you
0
I want explain only this part i have defined x before in code
0
20%50 = 20 ?!
0
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.
This is the porgrame