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

How did tobacco influenced the economic system of Jamestown
The Emancipation Proclamation freed most enslaved people in the South and North. all enslaved people in the United States. most enslaved people in the North and
How did a surplus of food affect the development of civilizations?
The product of 8 and a number q is at least 32
I need help ASAP!!!!!!
In the spring, the height of a vine was 30 inches. In the fall, the height of the vine was 120 inches. What was the percent of increase?
the length of a rectangle is 3 times the width. the perimeter is 96cm. find the length and width.
Molly shot 20 baskets in 4 minutes. Nico shot 42 baskets in 6 minutes. how many more baskets did Nico shoot per minute.
An artist used interlocking building blocks to build a scale model of Kennedy Space center,Florida. In the model, 1 inch equals 1.67 feet of an actual space shu
Mrs. Archangel deposited two checks, valued at $27.45 and $122.90, into her checking account last week. Then, she wrote three checks for $14.99, $32.49, and $43