Suppose that num is an int variable. Consider the following C++ code: cin >> num; (num...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Suppose that num is an int variable. Consider the following C++ code: cin >> num; (num > 0) switch a. b. { case 0: else C. d. num=static_cast (pow (num, 3.0)); case 2: break; } (num) num++num; case 4: break; case 5: num- num break; case 6: num num. num- num / break; case 10: num--; break; default: num- num + 10; cout < < num < < endl; num--20; 41 67 What is the output if the input is 5? What is the output if the input is 26? What is the output if the input is 2? What is the output if the input is -5? Suppose that num is an int variable. Consider the following C++ code: cin >> num; (num > 0) switch a. b. { case 0: else C. d. num=static_cast (pow (num, 3.0)); case 2: break; } (num) num++num; case 4: break; case 5: num- num break; case 6: num num. num- num / break; case 10: num--; break; default: num- num + 10; cout < < num < < endl; num--20; 41 67 What is the output if the input is 5? What is the output if the input is 26? What is the output if the input is 2? What is the output if the input is -5?
Expert Answer:
Answer rating: 100% (QA)
Outputs for the given C code a Input is 5 cinnum User inputs 5 if num0 50 tr... View the full answer
Related Book For
Computer organization and architecture designing for performance
ISBN: 978-0136073734
8th edition
Authors: william stallings
Posted Date:
Students also viewed these programming questions
-
CANMNMM January of this year. (a) Each item will be held in a record. Describe all the data structures that must refer to these records to implement the required functionality. Describe all the...
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Wilburton Hospital is investigating the possibility of investing in new dialysis equipment. Two local manufacturers of this equipment are being considered as sources of the equipment. After-tax cash...
-
B. Pedigo and W. Vernon have capital balances on January 1 of 50,000 and 40,000, respectively. The partnership income-sharing agreement provides for (1) annual salaries of 20,000 for Pedigo and...
-
The diversity of functional groups on sugars that can form glycosidic bonds greatly increases the information content of glycans relative to oligopeptides. Consider three amino acids, A, B, and C....
-
On February 11, 2009, plaintiff Levista, Inc. (plaintiff) filed against defendant Ranbaxy Pharmaceuticals, Inc. (defendant), pursuant to this Courts diversity jurisdiction under 28 U.S.C. 1332(a),...
-
Here is a work breakdown structure for a wedding. Use the method described in the Snapshot from Practice: The Yellow Sticky Approach to create a network for this project. Work Breakdown Structure 1....
-
Various people in the movie turn to Warren Buffett for advice and/or financial assistance, including Dick Fuld (Lehman Brothers), Lloyd Blankfein (Goldman-Sachs), Hank Paulson (Secretary of the...
-
Show that if G is a CFG in Chomsky normal form, then for any string w L(G) of length n 1, exactly 2n 1 steps are required for any derivation of w.
-
33 5 y = g(x) 5 y = f(x) x -5 The graphs of a linear function and a quadratic function g are shown in the xy-plane above. If f(g(k))=-3, what is the value of |k|?
-
Provide service for someone but they did'nt give me money yet , he must be pay 1 0 0 $ , but not received yet?
-
Differences Between Accounting and Nonaccounting Majors: There are notable differences in perceptions between accounting and nonaccounting majors. Nonaccounting majors are more likely to hold...
-
Thornton Boat Company makes inexpensive aluminum fishing boats. Production is seasonal, with considerable activity occurring in the spring and summer. Sales and production tend to decline in the fall...
-
Give current economy analysis, economy cycle and business cycle for the company- SECOND CUP COFFEE. With appropriate data, information and references to support your answer; show graphs for the same...
-
Give a strategy recommendation to the HR Director to be used for company-wide decisions.
-
IF nominal alpha is set to .01, which of these p values would be considered criteria for rejecting the null hypothesis? a). 0.002 b). 0.009 c). 0.04 d). 0.042
-
In the current year, the City of Omaha donates land worth $500,000 to Ace Corporation to induce it to locate in Omaha and create an estimated 2,000 jobs for its citizens. a. How much income, if any,...
-
Assume numbers are represented in 8-bit twos complement representation. Show the calculation of the following: a. 6 + 13 b. -6 + 13 c. 6 - 13 d. -6 - 13
-
Compare zero-, one-, two-, and three-address machines by writing programs to compute X = (A + B Ã C) / (D - E Ã F) for each of the four machines. The instructions available for use are...
-
List and briefly define the main structural components of a computer.
-
Should morality, in and of itself, be considered a sufficient basis for defining particular conduct as criminal?
-
What are the chief distinctions between the civil and criminal law? Why do the criminal and civil law sometimes overlap?
-
What means of punishment for criminal offenses exist in your state? Is capital punishment available for persons convicted of first-degree murder? Which punishments, if any, do you think are most...
Study smarter with the SolutionInn App