MrJohnDoe MrJohnDoe
  • 11-03-2020
  • 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 :

problemsolver2019
problemsolver2019 problemsolver2019
  • 17-03-2020

Answer:

The logic is clear from below program in python

a= input("ENTER THE NUMBER")

i=0

sum1=0

while(i <= int(a)):

    sum1 =sum1+i

    i=i+1

print(sum1)

Explanation:

Start

Enter number; n

sum=0

for i =0 to n

sum =sum+i

Next i

Print sum

End

Answer Link

Otras preguntas

According to Annie Leonard, in The Story of Stuff, contaminated water is worse from the landfill disposal system because
A large court during the baroque period might employ about ____________ performers. A. 18 B. 24 C. 80 D. 120
how is the communication on social media different from traditional media from a marketing perspective? how is the communication on social media different from
when a business records accrued interest expense on a note payable ________.
20pts please help!!!!!
within the scrum framework for agile software development, the prioritized list of project requirements collected from stakeholders prior to a sprint planning s
1) If the dollar price of the English pound goes from $1.50 to $1.75, the dollar has O appreciated, and Americans will find English goods more expensive. O depr
Aria conducted a scientific experiment. For a certain time, the temperature of a compound rose 1\tfrac{1}{4}1 4 1 ​ degrees every 1\tfrac{2}{3}1 3 2 ​ hours
Which of the following transformations will NOT map the flower onto itself?
Please help, this is a math question.