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
-
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....
-
Andover Bank and Lowell Bank each sell one-year certificates of deposit (CDs). The interest rates on these CDs are given in the following table for a three-year period. Suppose you deposit $1,000 in...
-
A researcher has obtained the following salary figures for the mayor, police chief, and fire chief for a sample of U.S. cities. Assuming these to be a random sample of major cities in the United...
-
A chemical engineer studied the effect of the amount of surfactant and time on clathrate formation. Clathrates are used as cool storage media. Table B. 8 summarizes the experimental results. a. Fit a...
-
Calculating EAC A five-year project has an initial fixed asset investment of $240,000, an initial NWC investment of $20000, and an annual OCF of $32,000. The fixed asset is fully depreciated over the...
-
1. State and describe in detail, the concept that must economically communicate what a brand is and what it is not. Give an example. 2. State and describe in detail a concept that describes a...
-
The spool has a mass of 30 kg and a radius of gyration k o = 0.25 m. Block A has a mass of 25 kg, and block B has a mass of 10 kg. If they are released from rest, determine the time required for...
-
Compute a three - week moving average forecast for the arrival of medical clinic patients in week 4 . The numbers of arrivals for the past three weeks were as follows: If the actual number of patient...
-
2. Draw a free body diagram for a. the massage therapist. Assume that ax = 0, ay = 0. (3) b. the client on the table. Assume that ax = 0, ay = 0 (3) c. the table. Assume that ax = 0, ay = 0 (3) 80 y X
-
Ia 5. Solve these two equations for a. mg sin 0-f=ma; f 2 r 6. Find in terms of from the given three equations. = fk-mg sin 0-0, N-mg cos 0=0, fk =N, Ans: k = tan 0 Ans: a = g sin 0 1+I/mr
-
2. Students perform a lab where they measure the relationship between drag and speed for an object of a given size and shape. The students use an electronic balance to determine the total mass of a...
-
2. Calculate the first derivative of the vector loop in the figure below, separate the Real and Imaginary components and simplify it as much as possible. Consider only angles 02, 03, 04 and vectors V...
-
At locations A and B, the electric potential has the values VA = 1.37 V and VB = 5.51 V, respectively. A proton released from rest at one of these locations passes through the other location. What is...
-
Comfi Airways, Inc., a small two-plane passenger airline, has asked for your assistance in some basic analysis of its operations. Both planes seat 10 passengers each, and they fly commuters from...
-
Consider model (9.18). What is the effect on the model parameter estimates, their standard errors, and the goodness-of-fit statistics when (a) The times at risk are doubled, but the numbers of deaths...
-
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
-
What are the numbers of observations in each of the five categories that rate the respondents level of job satisfaction?
-
Which of the seven store departments had the most customer visits, and what was this number?
-
How many individuals are in each of the five different credit card categories?
Study smarter with the SolutionInn App