Pls explain to me what of means. | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Pls explain to me what of means.

cout<< 50-(x%50) ;

27th Oct 2021, 11:14 AM
Kinan Alkadri
8 Answers
+ 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
27th Oct 2021, 11:29 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 2
Its error your x variable is undefined by the way % will give u remainder
27th Oct 2021, 11:18 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 2
According to the problem declear some variables and do calculation its simple first try it self
27th Oct 2021, 11:31 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 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
27th Oct 2021, 11:22 AM
A S Raghuvanshi
A S Raghuvanshi - avatar
+ 1
Ok thank you
27th Oct 2021, 11:32 AM
Kinan Alkadri
0
I want explain only this part i have defined x before in code
27th Oct 2021, 11:19 AM
Kinan Alkadri
0
20%50 = 20 ?!
27th Oct 2021, 11:26 AM
Kinan Alkadri
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
27th Oct 2021, 11:29 AM
Kinan Alkadri