What is the output of the following program #include #include using namespace std; double a (int...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
What is the output of the following program #include <iostream> #include <cmath> using namespace std; double a (int b[5]); int main() { double d=0, x,y; int z[5]=(3, 4, 3, 4, 5), i; x= a(z); cout<<x; for(i=0; i<5;i++) cout<<z[i]; } double a (int b[5]) { Enter your answer int w, e=0; for (int i=0; i<5; i++) { e+=pow (b[i],3); if(i==3) break; w=b[i]; b[i]=b[i+1]; b[i+1]=2; } return e; } What is the output of the following program #include <iostream> #include <cmath> using namespace std; double a (int b[5]); int main() { double d=0, x,y; int z[5]=(3, 4, 3, 4, 5), i; x= a(z); cout<<x; for(i=0; i<5;i++) cout<<z[i]; } double a (int b[5]) { Enter your answer int w, e=0; for (int i=0; i<5; i++) { e+=pow (b[i],3); if(i==3) break; w=b[i]; b[i]=b[i+1]; b[i+1]=2; } return e; }
Expert Answer:
Answer rating: 100% (QA)
Lets analyze the output step by step 1 The a function is called with the array z 2 Inside the a func... View the full answer
Related Book For
Posted Date:
Students also viewed these programming questions
-
If Q = 25 C, q = 10 C, and L = 40 cm in the figure, what is the magnitude of the electrostatic force on q? 9
-
After its move in 1990 to La Junta, Colorado, and its new initiatives, the DeBourgh Manufacturing Company began an upward climb of record sales. Suppose the figures shown here are the DeBourgh...
-
The L-shaped object described in the previous problem can be rotated in one of the following three ways: case A, about the x axis; case B, about the y axis; and case C, about the z axis (which passes...
-
The accompanying table gives the personal consumption expenditure and the corresponding disposable income (in billions of dollars) for the United States in the period 20032008: a. Plot these data on...
-
Air flows past two equal sized spheres (one rough, one smooth) that are attached to the arm of a balance as is indicated in Fig. P9.87. With \(U=0\) the beam is balanced. What is the minimum air...
-
Refer to the balance sheet data above from Anders Company. During 2015, a building with a book value of $70,000 and an original cost of $300,000 was sold at a gain of $60,000. a. How much cash did...
-
The switch statement has the following structure: switch (test variable or expression) { } case value_1: case value_2: The valid types of test variable (or expression) include all of the following,...
-
Use information on the endpapers of this book to calculate the average density of the Earth. Where does the value fit among those listed in Tables 1.5 and 14.1? Look up the density of a typical...
-
Discuss the nurse's role in the outcome of this case study. What nursing factors are relevant to the outcome? Nurses play a crucial role in various aspects of patient care, encompassing medication...
-
2) A company has six plants that can produce liquid sanitizing products with the characteristics shown in the following table. For the next production period, the manager must decide which plant to...
-
There's a total of 4 questions. Please answer all of them. Table 9.1 :https://ezt.prod.mheducation.com/Media/Connect_Production/bne/slater_14e/table_9_1.htm 5 10 points eBook Print References Drill...
-
2. Given the discrete systems below, show on the z-plane the possible regions of convergence. 2.1 G = 2.2 G 2.3 Gz = = 2+1 (23+2 + 2) z 2 +z+1 (z 0.1)(22 +z+ 0.5) - z 2 +z+1 (z 0.1)(z+z+0.5)
-
2. Consider the graph G with vertices V = {1,2,3,4,5} and edges E {{1,2}. {2,3}, {3.1}, {3, 4}, {4, 5}, {5,1}}. (a) Draw G. (b) How many cycles does G have? List them. (c) Is G bipartite? Explain....
-
In a Millikan type experiment, two horizontal plates are separated by a distance of 2.5 cm, and the upper plate is positive. The voltage to the plates is adjusted so that a 1.5 x 10-15 kg sphere...
-
Define and discuss the project topic you selected briefly but precisely in a 200-word essay. generally, you want to explore the policy, why it was developed, how it addresses a criminal justice...
-
What are the principal differences among asset liquidity management, liability management, and balanced liquidity management?
-
Write a program that copies your keyboard input (up to the simulated end-of-file) to a file named on the command line.
-
Design a function calculate() that takes two type double values and a pointer to a function that takes two double arguments and returns a double. The calculate() function should also be type double,...
-
Do Programming Exercise 1 from Chapter 9 but replace the code shown there with an appropriate golf class declaration. Replace setgolf(golf &, const char*, int) with a constructor with the appropriate...
-
Earnings is calculated deducting: A. Dividends on ordinary shares. B. Dividends on preference shares. C. Tax expense. D. Interest expense.
-
Set out in Figure 16.10 are summarized balance sheets and income statements for F Co. for 20X1 and 20X2. You are required to: Figure 16.10 a. prepare a table of ratios, covering all aspects of...
-
Under IFRS, income statements are required to show: A. Extraordinary items. B. Unusual items. C. Exceptional items. D. None of the above.
Study smarter with the SolutionInn App