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

How did the majority of Supreme Court justices in the case of Plessy v. Ferguson interpret the 14th Amendment?         A.
In a first aid kit the ratio of large bandages to small is 3 to 2 based on this ratio how many large bandages are in the kit if there are a total of 80 bandages
Which is greatest 895mm or 8,98mm?
In human DNA, adenine (A) makes up approximately 30.9% of the bases, and guanine (G) makes up approximately 19.9% of the bases; therefore the percentage thymine
Write an expression which solves for the radius of an object having a circumference of 46 feet.
What fraction of 1 gallon is 1 quart
I need a sentence with the word classify
I need a sentence with the word Fate in it!
12 times the square root of 2 equals ?
Which term best describes the relationship between the leopard seals and crabeater seals?    A.parasitism  B.predation  C.competition  D.mutualism