Consider the following C++ program. #include using namespace std; int fun(int &x, int y) { X=X+1;...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following C++ program. #include <iostream> using namespace std; int fun(int &x, int y) { X=X+1; y=y-1; return y; } int main() { int x = 2, y = 7, z = 10; string s = "007"; cout << ((double) y) / x << endl; // line (a) if (!((x > y) && (y> 5))) s = "008"; cout << s <<< endl; // line (b) z %= y; cout << Z << endl; // line (c) cout <<< fun(z, y) << endl; // line (d) fun(x, y); cout <<y-x*2<< endl; // line (e) } (a) What is the output at line (a)? (b) What is the output at line (b)? (c) What is the output at line (c)? d) What is the output at line (d)? ) What is the output at line (e)? Consider the following C++ program. #include <iostream> using namespace std; int fun(int &x, int y){ X=X+1; y=y-1; return y; } int main() { int x = 2, y = 7, z = 10; string s = "007"; cout << ((double) y) / x<< endl; // line (a) if (!((x > y) && (y> 5))) s = "008"; cout << s<<< endl; // line (b) z %= y; cout <<z << endl; // line (c) cout <<< fun(z, y)<< endl; // line (d) fun(x, y); cout <<y-x*2<< endl; // line (e) } (a) What is the output at line (a)? (b) What is the output at line (b)? (c) What is the output at line (c)? d) What is the output at line (d)? ) What is the output at line (e)? Consider the following C++ program. #include <iostream> using namespace std; int fun(int &x, int y) { X=X+1; y=y-1; return y; } int main() { int x = 2, y = 7, z = 10; string s = "007"; cout << ((double) y) / x << endl; // line (a) if (!((x > y) && (y> 5))) s = "008"; cout << s <<< endl; // line (b) z %= y; cout << Z << endl; // line (c) cout <<< fun(z, y) << endl; // line (d) fun(x, y); cout <<y-x*2<< endl; // line (e) } (a) What is the output at line (a)? (b) What is the output at line (b)? (c) What is the output at line (c)? d) What is the output at line (d)? ) What is the output at line (e)? Consider the following C++ program. #include <iostream> using namespace std; int fun(int &x, int y){ X=X+1; y=y-1; return y; } int main() { int x = 2, y = 7, z = 10; string s = "007"; cout << ((double) y) / x<< endl; // line (a) if (!((x > y) && (y> 5))) s = "008"; cout << s<<< endl; // line (b) z %= y; cout <<z << endl; // line (c) cout <<< fun(z, y)<< endl; // line (d) fun(x, y); cout <<y-x*2<< endl; // line (e) } (a) What is the output at line (a)? (b) What is the output at line (b)? (c) What is the output at line (c)? d) What is the output at line (d)? ) What is the output at line (e)?
Expert Answer:
Answer rating: 100% (QA)
The output for the required lines would be as follows 2 L... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
Find the coordinates of the labeled points. 1. 2. x =3 2r + 3y = 18 R y = -x +7 y = -x + 9 y = -3r + 19 D
-
As at 1 January 2010 salary outstanding was 128,400. During the year ended 31 December 2010 598,800 was paid as salary and as at 31 December 2010 salary amounting to 142,900 remained unpaid. What is...
-
All the waves shown have the same speed in the same medium. Use a ruler and rank these waves from most to least for a. Amplitude. b. Wavelength. c. Frequency. d. Period. A B C D
-
Find the laurents series f(z)= 1/(z-1)(z-2) (i) |z| <1 (ii) 1 2
-
Consider the functions f (x) = 4x and g(x) = x + 6. (a) Find (f o g) (x). (b) Find (f o g) 1(x). (c) Find f 1(x) and g1(x). (d) Find (g1 o f1) (x) and compare the result with that of part (b). (e)...
-
Naphthalene, C 10 H 8 , melts at 80.2C. If the vapour pressure of the liquid is 1.3 kPa at 85.8C and 5.3 kPa at 119.3C, use the ClausiusClapeyron equation to calculate (a) The enthalpy of...
-
Given the following information, compute the firms free cash flows and the financing cash flows. Dividends $25 Change in common stock $ 27 Change in inventories $ 32 Change in accounts receivable $...
-
On January 1, 2011, Clearwater Corporation sold a $750,000, 8 percent bond issue (9 percent market rate). The bonds were dated January 1, 2011, pay interest each December 31, and mature in 10 years....
-
How do you print the first value in a tuple called aVar?
-
Web site, which contains Henley Corporation?s most recent financial statements. Use the following ratios and other selected information for the current and projected years to answer the questions...
-
Suppose that you borrow $1000.00 from a friend and promise to pay back $1975.00 in 5 years. What simple interest rate will you pay?
-
What experiences could you provide to expose children to artists from diverse cultures? How could you provide experiences for children to be exposed to Aboriginal and/ or Torres Strait Islander...
-
How do Promotions and Compensation go hand and hand? Do people want opportunities to grow in their careers, if they don't find it in their organization will they find it elsewhere?
-
Outsourced systems: (S) LO2) a) Eliminate the need for the employer to have knowledgeable payroll staff' b) Transfer all compliance responsibility from the employer to the service provider c) Reduce...
-
Describe 3 different scenarios where social and/or human capital have played a role in conflict or negotiation outcomes. In your most recent job, describe the degree of social and human capital you...
-
In this assignment I will be using the dataset released by The Department of Transportation. This dataset lists flights that occurred in 2015, along with other information such as delays, flight time...
-
Ali Harooz runs a small Business unit. He is concerned with the liquidity position of his firm as he has heard that liquidity problems are one of the most frequent explanations for business failure....
-
Hardin Services Co. experienced the following events in 2016: 1. Provided services on account. 2. Collected cash for accounts receivable. 3. Attempted to collect an account and, when unsuccessful,...
-
A third-grade teacher at Potter Elementary School wants a program that allows a student to enter the amount of money a customer owes and the amount of money the customer paid. The program should...
-
The manager of Keystone Tile wants an application that displays the area of a rectangular floor, given its measurements in feet. It should also display the total cost of tiling the floor, given the...
-
Write the code to display the contents of the balances array from Pencil and Paper Exercise 1. Use two for statements to display the array, row by row.
-
Use a HashMap to create a reusable class for choosing one of the 13 predefined colors in class Color. The names of the colors should be used as keys, and the predefined Color objects should be used...
-
Use SecureRandom method ints to generate a stream of 50 random numbers in the range 1 to 999, then filter the resulting stream elements to select only the odd numbers and display the results in...
-
(a) What percentage of those not completing high school were females? (b) What percentage of those not completing high school were males? (c) What percentage of those completing high school were...
Study smarter with the SolutionInn App