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

can someone help please ​
Amanda can proofread 17 reports in an hour, while Sally can proofread 28 reports in an hour. If they have 420 reports to proofread, how much time will it take
During the ___________________ years, most children gradually become sensitive to the sounds of spoken words. They show this phonological awareness in such ways
What happens in capillaries?
Explain how a puncture to the thoracic cavity (from a knife wound, for instance) could alter the ability to inhale.
A farmer is tracking the amount of wheat his land is yielding each year. He finds that the function f(x) = −x2 + 20x + 75 models the crops in pounds per acre ov
If cosine theta equals negative square root of three over two and pi over two less than theta less than pi, what are the values of sin Θ and tan Θ? sine theta
Freedom of speech can be limited or restricted in cases involving
Why have we learned a lot about star formation since the invention of detectors sensitive to infrared radiation?
Can someone write an explicit formula for the following sequence for me?: 3, -4, -11, -18,... The d=-7.
good job