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
-
A flock of geese is attempting to migrate due south, but the wind is blowing from the west at 4.7m/s. a) If the birds can fly at 7.9m/s relative to the air, what direction should they head?
-
The serratus posterior superior andserratus posterior inferior are both involved in respiration but invery different ways. Knowing this, answer the following questions(1-3): What function does each...
-
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...
-
On October 1, 2015, Jenco signed a four-year, $100,000 note payable to Vicksburg State Bank in conjunction with the purchase of equipment. The note calls for interest at an annual rate of 12 percent...
-
The following partially completed worksheet has been prepared for the 2007 statement of cash flows of the Perrin Company: Other relevant information (a) (b) Accumulated depreciation is a contra...
-
Use your calculator to calculate \(19+(-36)\). Explain how the answer agrees with what was expected.
-
Closing and opening stores Sanchez Corporation runs two convenience stores, one in Connecticut and one in Rhode Island. Operating income for each store in 2009 is as follows: The equipment has a zero...
-
One year ago, you purchased a stock at a price of $32.50. The stock pays quarterly dividends of $.40 per share. Today, the stock is worth $34.60 per share. What is the total amount of your dividend...
-
The following information is available for ADT Company, which produces special-order security products and uses a job order costing system. Overhead is applied using a predetermined overhead rate of...
-
Your 23 years old client just graduated from college and started a job with monthly salary of $5,000 per month. He wants to retire when he is 60 years old and wants to start saving for retirement...
-
What is behavioral targeting? How can it be used to exploit business opportunities? What ethical problems can arise from behavioral targeting on the internet? How can combining ethics and psychology...
-
Cooking pots have loose-fitting lids to allow air to escape while food is being heated. If a 1.5-L saucepan is heated from 22C to 100C, any gas in the pan will increase in volume by what percentage?
-
Discuss the impact of process simulation in the design and scaling-up of chemical plants. How do advanced modeling techniques, such as Computational Fluid Dynamics (CFD) and Discrete Element Method...
-
What replacement behavior could be taught to a student as part of a behavior intervention plan and what type of generalization could be used to help the student apply that behavior to a different...
-
Choose one of the four basic leader behavior styles suggested by Hersey and Blanchard. Discuss the specifics of the task and relationship behaviors of the chosen style. Provide a realistic example of...
-
1. Grouper Corp. has decided to expand its operations. The bookkeeper recently completed the following statement of financial position in order to obtain additional funds for expansion: GROUPER CORP....
-
Suppose the government bond described in problem 1 above is held for five years and then the savings institution acquiring the bond decides to sell it at a price of $940. Can you figure out the...
-
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...
-
6. CPA QUESTION In order to negotiate bearer paper, one must: a. Indorse the paper b. Indorse and deliver the paper with consideration c. Deliver the paper d. Deliver and indorse the paper
-
7. On June 30, John N. Willis signed a demand promissory note for $1,620 to the Camelot Country Club in Carrollton, Texas. The note stated that it was being given in payment for a membership in the...
-
9. Barry Minkow founded ZZZZ Best, a publicly traded carpet cleaning company. The company had a $5 million line of credit from Prudential Bache. Sheri Elowsky
Study smarter with the SolutionInn App