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
-
Workplace, International is re-evaluating the design, cost and profitability of its line of office accessories. Currently, the items are constructed of metal-based parts for durable and consistent...
-
As a recent graduate, you are considering employment offers from three different companies. However, in an effort to confuse you and perhaps make their offers seem better, each company has used a...
-
What is the difference between internal ecological accounting and the other two types of ecological accountingexternal ecological accounting and other ecological accounting?
-
The company paid $500,000 to purchase the following: a building with an appraised value of $200,000, an operating permit valued at $100,000, and ongoing research and development projects valued at...
-
A. Discuss the special role that branding plays in service companies. B. What do servicescapes, personal selling and service encounters have in common?
-
The CyClon project team has started gathering information necessary to develop a project network-predecessor activities and activity time in days. The results of their meeting are found in the...
-
Harry and sally were married on december, 28 so they could spend part of their honeymoon celebrating new year's eve in new york city. when it comes to filing his federal income taxes, which day of...
-
A steel mono-pile needs to be constructed to hold a monitoring station. The monitoring station should be 20 feet above the still water level, SWL, of 55 feet. The superstructure including the...
-
Explain the advantages and disadvantages inherent in each of the four business forms with regard to contract creation, negotiation, and approval of contracts.
-
1) What is Philosophy? Do you have a personal philosophy in life? If so, what is your personal philosophy? 2) Differentiate ethics from morality. 3) Why is ethics called a normative science?...
-
At gunpoint, a convenience shop was robbed in the middle of the day. The culprit was seen on the store's security camera, and a composite sketch was created from the footage. The owner of the...
-
Assume Ganado enters into a swap agreement to receive euros and pay Japanese yen, on a notional principal of 5,000,000. The spot exchange rate at the time of the swap is 104/. (When you answer the...
-
Show that the function is differentiable at x = 0. f(x) = [r 0 x sinif x #0 if x = 0
-
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.
-
Refer to Problem 3-56B. 1. Use the For You eTravel Inc. data in problem P3-56B to prepare the company's classified balance sheet at December 31, 2020. Show captions for total assets, total...
-
The accounts of For You eTravel Inc. at December 31, 2020, are listed in alphabetical order. Requirements 1. All adjustments have been journalized and posted, but the closing entries have not been...
-
The adjusted trial balance of Reid and Campbell Ltd. at December 31, 2020, appears below. Requirements 1. Prepare Reid and Campbell Ltd.'s 2020 income statement, statement of retained earnings, and...
Study smarter with the SolutionInn App