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

Read the excerpt from “Gawayne” What do the giants words reveal about him He is very confident He is scared I’d Arthur He is very intelligent He is glad to
The steps in the writing process include: A. editing, drafting, feedback, and prewriting. B. brainstorming, outlining, drafting, editing, feedback, and making f
What is the greatest common factor of 48 and 84?O 6O 9O 12O 14​
Help please don’t understand
What feature is typical of the Gupta Empire under the rule of Chandra Gupta Il? People were forced to work for the government. People were treated unfairly an
Over 850 languages are spoken in Papua New Guinea. Please select the best answer from the choices provided T F
If y=15 when x=5, find y when x=7, given that y varies directly with x.
Which religion made its way to India between 700 and 800 CE? A. Islam B. Buddhism C. Hinduism D. Christianity
pls help, ill give brainlist if u answer this :) help me
Which nutrients can your body use as sources of energy?