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...
-
After liquidating non-cash assets and paying creditors, account balances in the CAB Co. are Cash 21,000, C Capital (Cr.) 9,000, A Capital (Cr.) 7,000, and B Capital (Cr.) 5,000. The partners share...
-
XYZ plc, a paint manufacturer, operates a process costing system. The following details related to process 2 for the month of October: There are no further processing costs associated with either...
-
Using rules of thumb for a \(200 \mathrm{~m}^{2}\) floor area Denver residence, determine (a) the auxiliary heating energy required, (b) the solar projected area, (c) the concrete storage mass needed...
-
Equipment replacement, no income taxes. Pro Chips is a manufacturer of prototype chips based in Dublin, Ireland. Next year, in 2010, Pro Chips expects to deliver 552 prototype chips at an average...
-
Four independent situations are described below. Each involves future deductible amounts and/or future taxable amounts produced by temporary differences: Taxable income Future deductible amounts...
-
Bunky Eats recently paid $1.65 as an annual dividend. Future dividends are projected at $1.68, $1.72, $1.76, and $1.80 over the next four years, respectively. In year 5, the dividend is expected to...
-
Suppose Payton took advantage of Medas benefits. Do you believe this would result in feeling less stressed and improvements in well-being? Why or why not?
-
Discuss the concept of thermal equilibrium and state zeroth law of thermodynamics.
-
Explain and derive steady flow energy equation (SFEE).
-
What do you understand by quasi-static process? How it is achieved?
-
Distinguish between the term 'change of state', 'path', and 'process'.
-
6.4. The line constants of a transmission line are A= 0.9301 0.98 and B= 141.24 8187 ohm, The load at the receiving end is 60 MVA, 50 Hz, 0.8 pf lagging. The supply voltage is 220 kV. Calculate the...
-
For all of the following words, if you move the first letter to the end of the word, and then spell the result backwards, you will get the original word: banana dresser grammar potato revive uneven...
-
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.
-
(a) For the standard normal distribution, plot the PDF in equation (3.101) for four values of \(\alpha, \alpha=-1, \frac{1}{2}, 1,2\), along with the PDF of the standard normal. (b) Generate 1,000...
-
Consider a random sample of size \(n\) from the unit Pareto distribution with PDF \[ f(x)=2 x^{-2} \quad \text { for } 0 \leq x \] that is, for the Pareto with \(\alpha=2\) and \(\gamma=1\). (a)...
-
(a) Let \(X\) be a random variable with a location-scale t distribution with 3 degrees of freedom, location 100, and scale 10. i. What is the probability that \(X\) is less than or equal to 110 ? ii....
Study smarter with the SolutionInn App