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

In a relay race, the probability of the Galaxy team winning is 22%. In another unrelated race, the probability of the Komets team winning is 47%. If the possibi
Can someone please answer. There is one problem. There's a picture. Thank you!
If 0.507 moles of zinc reacts with excess lead(IV) sulfate, how many grams of zinc sulfate would be produced in the following reaction?
Which statements are true for the function y = |x| - 2? Select all that apply. The value of the function is never negative. Its graph has a V-shape. There is on
What event was aimed at driving western influence out of China?
What are the living components of the environment that interact within an ecosystem
Germany lost an important World War II ally when A. France fell to US and British forces. B.the Soviet Union invaded Germany. C.the Soviet Union surrendered to
Gino is buying wood screws at the corner hardware store. The table shows different numbers of bags of screws and their corresponding prices. Bags of Screws Pr
tiesWhat is the value of n?1446Answer:
Please Help! In circle P, what is the measure of arc DAB?