What number will the following code display on the computer screen? int sum = 0; int y
Question:
What number will the following code display on the computer screen?
int sum = 0;
int y = 0;
do
{
for (int x = 1; x <= 5; x += 1)
sum += x;
//end for
y += 1;
} while (y < 2);
cout << sum << endl;
a. 5
b. 8
c. 15
d. 30
Fantastic news! We've Found the answer you've been seeking!
Step by Step Answer:
Answer rating: 75% (16 reviews)
Answered By
Ali Khawaja
my expertise are as follows: financial accounting : - journal entries - financial statements including balance sheet, profit & loss account, cash flow statement & statement of changes in equity -consolidated statement of financial position. -ratio analysis -depreciation methods -accounting concepts -understanding and application of all international financial reporting standards (ifrs) -international accounting standards (ias) -etc business analysis : -business strategy -strategic choices -business processes -e-business -e-marketing -project management -finance -hrm financial management : -project appraisal -capital budgeting -net present value (npv) -internal rate of return (irr) -net present value(npv) -payback period -strategic position -strategic choices -information technology -project management -finance -human resource management auditing: -internal audit -external audit -substantive procedures -analytic procedures -designing and assessment of internal controls -developing the flow charts & data flow diagrams -audit reports -engagement letter -materiality economics: -micro -macro -game theory -econometric -mathematical application in economics -empirical macroeconomics -international trade -international political economy -monetary theory and policy -public economics ,business law, and all regarding commerce
4.00+
1+ Reviews
10+ Question Solved
Related Book For
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell
Question Posted:
Students also viewed these Computer science questions
-
What numbers will the following code display on the computer screen? int x = 0; do { cout < < x < < endl; x += 1; } while (x < 5); a. 0, 1, 2, 3, 4 b. 0, 1, 2, 3, 4, 5 c. 1, 2, 3, 4 d. 1, 2, 3, 4, 5
-
What numbers will the following code display on the computer screen? int total = 1; do { total += 2; cout < < total < < endl; } while (total
-
What pattern of asterisks will the following code display on the computer screen? for (int x = 1; x < 3; x += 1) { for (int y = 1; y < 4; y += 1) cout < < *; //end for cout < < endl; } //end for a....
-
Four people, each with a mass of 72.4 kg, are in a car with a mass of 1 130 kg. An earthquake strikes. The driver manages to pull off the road and stop, as the vertical oscillations of the ground...
-
Consider the quadratic equation x2 - 2x + c = 0 where c is a real number. Discuss the relationship between the values of c and the three types of roots listed in Table 1.
-
Explan: 1. How human rights violation affects communication? 2. Explain the image below about globalization and communication. FAKE NEWS 53333535 5555555 CLICK f 000 000 000 (O) M 222 20
-
Define the legal terms precedent, res judicata, stare decisis, original jurisdiction, and appellate jurisdiction.
-
Annual revenue for Corning Supplies grew by 5.5% in 2007; 1.1% in 2008; 3.5% in 2009; 1.1% in 2010; and 1.8% in 2011. What is the mean growth annual rate over this period?
-
The Belfood Malaysia manufactures 1 2 0 0 0 units. Belfood Malaysia sold 1 0 0 0 units. The Company has fixed manufacturing overhead of RM 2 , 0 0 0 . Direct materials cost is RM 5 per unit, direct...
-
Name the advantages and disadvantages of user acknowledgements in WTP. What are typical applications for both cases?
-
What value of x causes the loop in Review Question 5 to end? int x = 16; do { cout < < x < < endl; x -= 4; } while (x > 10); a. 0 b. 8 c. 10 d. 12
-
Chakura is sitting at a table in a bookstore, attending her book signing. Customers are standing in line waiting for her to sign their copy of her book. However, it is possible that some customers in...
-
Last year a dollar was equal to 7 Swedish kronor, and a Polish zloty was equal to $.40. Today, the dollar is equal to 8 Swedish kronor and a Polish zloty is equal to $.44. By what percentage did the...
-
Review the comparative strengths and weaknesses of product versus functional departmentation.
-
Compare and contrast programmed and non-programmed decision making.
-
Define consideration and initiating structure. Which leader behaviour is the most effective?
-
What is voice and why should organizations encourage it?
-
How do the moderating variables influence outcomes in the Job Characteristics Model?
-
Tim is a real estate broker who specializes in commercial real estate. Although he usually buys and sells on behalf of others, he also maintains a portfolio of property of his own. He holds this...
-
1. Below is depicted a graph G constructed by joining two opposite vertices of C12. Some authors call this a "theta graph" because it resembles the Greek letter 0. a. What is the total degree of this...
-
A method that detects an error condition or exception ____________ an Exception. A. Throws B. Catches C. Handles D. Encapsulates
-
A try block includes all of the following elements except ____________. A. The keyword try B. The keyword catch C. Curly braces D. Statements that might cause exceptions
-
The segment of code that handles or takes appropriate action following an exception is a ____________ block. a. try b. catch c. throws d. handles
-
The hydrogen spectrum shows 4 lines in the region visible spectral (this series is called the Balmer series: H (red): =656.3 nm, H(blue-green): = 481.1 nm, H (purple): = 434.1 nm, and H(purple): =...
-
A ring-shaped conductor with radius a = 2.50 cm has a total positive charge Q=0.123 nC uniformly distributed around it. (Eigure 1) What is the magnitude of the electric field at point P, which is on...
-
What are the main role of a businessmen to build the good business relation and communication to make the business better everyday?
Study smarter with the SolutionInn App