What is the output of the following C++ code? int x = 10; int y =...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
What is the output of the following C++ code? int x = 10; int y = 20; if (x < 10 || y> 20) { x = 2 * x; y=y/2; cout << y << " " << x + y << endl; } else } { x=y/x; y=x*y; cout << x << " " <<y-x << endl; What is the output of the following C++ code? int x = 10; int y = 20; if (x < 10 || y> 20) { x = 2 * x; y=y/2; cout << y << " " << x + y << endl; } else } { x=y/x; y=x*y; cout << x << " " <<y-x << endl;
Expert Answer:
Answer rating: 100% (QA)
Lets analyze the code int x 10 int y 20 if x 10 y 20 x 2 x y y 2 else cout y x y endl x y ... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
The Shady company purchased equipment on January 1, 2020. The cost of the equipment is $70,000, the residual value is $6,000, and it has a useful life of 4 years. The company's year end is December...
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Write a paper on security controls available for Operating systems and more specifically it deals with firewalls and DLPs(data loss prevention). Share any experiences you may have had where an...
-
Simplify the following expressions according to the commutative law: a. b. A B + A C + B A c. (L M N)(A B)(C D E)(M N L) d. F (K + R) + S V + W + V S + W + (R + K) F A.B + B.A + C.D.E + C.DE + E.T.D
-
You have been provided with the following selected accounts for Sparkles Inc. for the year ended June 30, 2012: Sparkles conducted a physical inventory count on June 30, 2012. Inventory on hand at...
-
Presented below are financial statement classifications for the statement of comprehensive income and the retained earnings statement. For each transaction or account title, enter in the space...
-
Convertibles are great because they offer a lower return than straight debt and we just dish out shares rather than have to find cash to redeem the bonds executive at Myopic plc. Comment on this...
-
You are auditing inventory of HUSKY Corp. as of December 31, 2007.The inventory general ledger balance is $8,124,998.66. HUSKY manufactures lawn and garden tractors, snowmobiles, and supplies....
-
Sheffield Navigation began operations in 2020 and provides a one-year warranty on the products it sells. It estimates that 19100 of the 409000 units sold in 2020 will be returned for repairs and that...
-
Table 6E.9 presents 20 subgroups of five measurements on the critical dimension of a part produced by a machining process. (a) Set up x and R control charts on this process. Verify that the process...
-
Which of the below assumptions is necessary when using the constant growth (percentage of sales) method of forecasting financial statements? A. Most income statement items and balance sheet accounts...
-
How do motivation and leadership affect corporate culture?
-
Will TAFTA provide new market opportunities for some of the products you identified? Why or why not? The United States and the EU have agreed to negotiate a new Transatlantic Free Trade Agreement...
-
How might attitudes, motivation, and leadership affect one another in organizational settings?
-
What are the five forms of regional economic integration? How do they differ from one another?
-
Describe how you might use the Big Five personality traits when forming a cross-cultural project team.
-
Briefly explain the Mapp v Ohio 1961 court case and how this relates to the violation of the fourth amendment and how this is of importance to our culture now?
-
What does non-recourse financing mean?
-
Which of the following is false? a. When you pass a variable by reference, the receiving function can change the variables contents. b. When you pass a variable by value, the receiving function...
-
In this exercise, you complete a program that uses the FormattedDate class shown in Figure 15-1 in the chapter. Follow the instructions for starting C++ and viewing the TryThis8.cpp file, which is...
-
Rewrite the code from Pencil and Paper Exercise 4 using the do while statement in the outer loop and the while statement in the nested loop.
-
Stanford Corporation began the year with 150,000 shares of common stock outstanding. On March 1, an additional 10,000 shares of common stock were issued. On August 1, another 16,000 shares of common...
-
The following summarized data relate to Robert Corporation's current operations: Required Prepare a multiple-step income statement for Robert Corporation for the year. Include earnings per share...
-
Net sales, net income, and total asset figures for Janice Controls, Inc., for five consecutive years are given below (Janice manufactures pollution controls): Required a. Calculate trend percentages,...
Study smarter with the SolutionInn App