Rewrite the following code using while statement. #include using namespace std; int main() { } int...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Rewrite the following code using while statement. #include <iostream> using namespace std; int main() { } int i, x, sum=0; for(i=0; i<8; i++){ cin>>x; sum = sum+x; } cout<<"" <<sum; return 0; Rewrite the following code using while statement. #include <iostream> using namespace std; int main() { } int i, x, sum=0; for(i=0; i<8; i++){ cin>>x; sum = sum+x; } cout<<"" <<sum; return 0;
Expert Answer:
Answer rating: 100% (QA)
include using namespace std int main int i 0 int x sum 0 while i 8 c... View the full answer
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Posted Date:
Students also viewed these programming questions
-
Correct the errors in the lines of code shown in Figure 4-34. (The code contains eight errors.)
-
Doprogramming exercisetop_div_structures.cpp: Modify last week's program (top_div_arrays.cpp) one more time, by converting both related arrays to one array of structures. Include the following:Use...
-
C++ code has segmentation fault. Need help CPP file: buffers #include "vector.h" #include #include //We do not want to include either stmt. We wouldn't ////be able to compare our vector template to...
-
Let us first assume that an estimate k; of the queue length at the beginning of the i-th slot is available. In possession of that in- formation the Pseudo-Bayesian Algorithm is such that each node...
-
How high would you have to go in the atmosphere for half of the mass of air to be below you?
-
Leonard Andrews ended his employment with Atlas Inks on March 20, 2021. When is the earliest that Atlas Inks may destroy his payroll records? March 21, 2022 March 21, 2023 March 21, 2024 March 21,...
-
For the pressure-swing dehydration of THF, determine the internal flow rates when the high-pressure column is at 5 bar.
-
Nixon Communications is trying to estimate the first-year operating cash flow (at t = 1) for a proposed project. The financial staff has collected the following information: Projected sales $10...
-
Let a and b be two constants. Two lines L1 and L2 are given as follows: L = at, y=1-t,z=t+1,tR L2x=s,y=bs, z=s, sR (1) Suppose L1 and L2 are parallel. Find the values of a and b. (2) For the values...
-
Say-on-pay votes by shareholders are now quite common. Occasionally, shareholders' non-binding votes do not approve executive compensation. For example, in 2013, share holders of Barrick Gold Corp....
-
Correct the information needed and fill the information missing using the table format bellow Determine the cost of goods sold and the cost of ending inventory. The company uses the perpetual...
-
How important is an authoritarian government to Singapore's success? Would it be possible to have more civil liberties and a less intrusive state and still maintain Singapore's prosperity? Does...
-
I am reading Organizational Change: Perspectives on Theory and Practice, and my assignment is to write about " how engagement with organizational change depends upon trust". Can you help me out?
-
what are thee employment law applied in Kenya? Do I need an employment contract? When should an employment contract be signed? Are employers obligated to investigate reports of workplace harassment?
-
1. What should a marketer do if, in choosing target segments, he or she runs out of attractive segments to add to the list of targeted segments and it does not appear that objectives can be met? 2....
-
How do socioeconomic factors impact access to healthcare, and what strategies can improve healthcare equity for underserved populations?
-
Prospo Ltd is a major manufacturer of medical diagnostic machines and advanced surgical equipment for the Health Services industry. Prospo uses a complicated accounting information system called ZAP....
-
The sales department of P. Gillen Manufacturing Company has forecast sales in March to be 20,000 units. Additional information follows: Finished goods inventory, March 1 . . . . . . . . . . . . . . ....
-
If the state variable contains the two letters MI followed by three spaces, which of the following statements will remove the three spaces from the variables contents? a. state.erase(" "); b....
-
The algorithm shown in Figure 2-42 should calculate and display the total amount due, but it is not working correctly. Correct the algorithm, and then desk-check it using 20, $0.25, and .045 (the...
-
Start your C++ development tool, and view the SwatTheBugs17.cpp file. The file is contained in either the Cpp8\Chap05\SwatTheBugs17 Project folder or the Cpp8\Chap05 folder. (Depending on your C++...
-
Compare and discuss the estimated longitudinal compressive strengths of Scotchply 1002 E-glass/epoxy based on (a) fiber microbuckling and (b) transverse tensile rupture. Assume linear elastic...
-
Using the maximum strain criterion and micromechanics, set up the equations for predicting the averaged isotropic strength of a randomly oriented continuous fiber composite. Your answer should be...
-
For a cylindrical particle, derive the relationship between the ratio of surface area to volume, A/V, and the particle aspect ratio, l/d, and verify the shape of the curve shown in Figure 1.3. FIGURE...
Study smarter with the SolutionInn App