Consider the following code segment written in C++ to print even numbers between 50 to 60...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Consider the following code segment written in C++ to print even numbers between 50 to 60 in descending order: #include<iostream> using namespace std; int main(){ int counter = 60; while(counter <50){ if(counter %2 == 0){ cout<<counter<<endl; counter --; return 0; What are the error(s) with the C++ codes provided above? Consider the following code segment written in C++ to print even numbers between 50 to 60 in descending order: #include<iostream> using namespace std; int main(){ int counter = 60; while(counter <50){ if(counter %2 == 0){ cout<<counter<<endl; counter --; return 0; What are the error(s) with the C++ codes provided above?
Expert Answer:
Answer rating: 100% (QA)
The code snippet intends to print even numbers between 50 to 60 in descending order using C Here are ... 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
-
3. Let the matrices F and G be defined as below. Answer the following questions accordingly. 0 21 F=2-1 3 [24 1 0,G 03-2 15 0 a. Let x 2, and let Gx = y. Compute Gx and compute Fy. b. Let x=2, and...
-
Correct the errors in the lines of code shown in Figure 4-34. (The code contains eight errors.)
-
This assignment reviews object-oriented programming concepts such as classes, methods, constructors, accessor methods, and access modifiers. It makes use of an array of objects as a class data...
-
Give parametric equations and parameter intervals for the motion of a particle in the xy-plane. Identify the particles path by finding a Cartesian equation for it. Graph the Cartesian equation....
-
A value stream has three activities and two products. The units produced and shipped per week are 50 of the deluxe model (Model A) and 150 of the basic model (Model B). The resource consumption...
-
Using the CIDR notation, show the IPv6 address compatible to the IPv4 address 129.6.12.34.
-
Environmental vulnerability of amphibians. Refer to the Amphibian & Reptile Conservation (Aug. 2013) study of Environmental Vulnerability Scores (EVS) for amphibian species native to Mexico, Exercise...
-
The Enron debacle created what one public official reported was a crisis of confidence on the part of the public in the accounting profession. List the parties who you believe were most responsible...
-
Destin Company produces water control valves, made of brass, that it sells primarily to builders for use in commercial real estate construction. These valves must meet rigid specifications (i.e., the...
-
The accountant preparing the financial statements has asked you to provide the fair value as of the end of the year for the investments. Present the information as it would be shown on the financial...
-
GENERAL MILLS INC. Consolidated Balance Sheet $ millions, except par value May 29, 2016 $ 763.7 1,360.8 1,413.7 399.0 Current assets Cash and cash equivalents... Receivables ........ Inventories...
-
Case # 4 Joseph Joseph, a 19-year-old African American college freshman. Yesterday he spent the afternoon drinking beer and taking shots of vodka with his fraternity brothers. After 6 glasses of beer...
-
1. Kaldor facts [50 points] Kaldor (1961) documented a set of stylized facts on the growth process of industrialized countries. We discussed these facts in lecture 2. Explain if and how the...
-
County has the Investment Activities recorded in its general fund: Tesla Stock: Cost $100, Fair Value on Jan 1x1: $200; Fair Value on Dec 31x2: $300 DJT Stock: Cost: $100; Fair Value on Jan 1x1:...
-
Pets World is a retailer of a popular blend of organic dog food produced by Natural Pets Company. On average, Pets World sells 600 cans per week. The wholesale price that Natural Pets Company charges...
-
Out Supply-Chaining the King of Supply Chainers, How easy (or hard) would it be for rivals like Walmart or Carrefour to adopt Tesco's data management techniques? (Please provide reference...
-
Consider the following two mutually exclusive projects: Year Cash Flow (A) Cash Flow (B) 0 $ 513,000 $ 98,000 1 126,000 40,000 2 146,000 38,000 3 81,000 35,500 4 457,000 30,600 Whichever project you...
-
Below is a sample of the data in the file NFLAttendance which contains the 32 teams in the National Football League, their conference affiliation, their division, and their average home attendance....
-
Baxter Skating Rink holds a weekly ice-skating competition. Competing skaters must perform a two-minute program in front of a panel of judges. The number of judges varies from week to week. At the...
-
Create a program that displays a table consisting of ten rows and four columns. The first column should display prices from $5 to $50 in increments of $5. The second and subsequent columns should...
-
If you use a real number to initialize an int variable, the real number will be _____________________ before it is stored in the variable. a. Demoted b. Promoted c. Reduced d. Upgraded
-
Demonstrate that the matrix ij = ij is positive semi-definite for all 1 i 1 3
-
Using the PewSocialMedia dataset, run a regression to analyze the relationship between education (use the recoded XYeduc variable) and the respondents score on the Index of Upsettedness. Interpret...
-
Run a correlation matrix using the following WVS variables related to election corruption: ELECBRIBE, ELECPREVENT, ELECRICHBUY, and ELECVIOL. Which variables are most correlated with one another?...
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App