stephenpowellrules stephenpowellrules
  • 08-02-2022
  • Computers and Technology
contestada

design the logic for a program that allows a user to enter a number. display the sum of every number from 1 through the entered number

Respuesta :

jmann9574
jmann9574 jmann9574
  • 08-02-2022

Answer: int sum = 1, n;

do {cin>>n; sum+=n;}while (n!=0);

cout<<sum;

Explanation:

Answer Link

Otras preguntas

Geoff purchased an annual golf pass for a municipal golf course in his town. He pays a flat fee for the annual golf pass and then each round he plays he must pa
Consider the composite function g(f(x)) =x√6. If f(x) = 3x², what is g(x)? O g(x)=√2x Og(x)=√x+3 Og(x)=√6x O g(x)=√9-x
it takes 32 pounds of seed to completely plant a 5 -acre field. How many acres can be planted per pound of seed?
Find the value of 'x', round to 4 decimal places.
SELECT just ONE of the following conflicts (OR, you can choose a different conflict) from The Tempest. Explain the way the conflict impacts characters and your
A standard deck of 52 cards contains four suits: clubs, spades, hearts, and diamonds. Each deck contains an equal number of cards in each suit. Rochelle chooses
A taxi service charges $1.50 plus $0.60 per mile for a trip to the airport. The total charge is $13.50. Which equation can be used to determine the number of mi
What is important about Thomas Jefferson's 1801 inaugural address?
Click an item in the list or group of pictures at the bottom of the problem and, holding the button down, drag it into the correct position in the answer box. R
How much money should be put into a savings account now that earns 6.0% a year compounded weekly if you want to have 70000 in 15 years?