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

Please answer!!!?????
In a small company's accounting department, the accounts receivable coordinator often takes the role of the ___.
Which statement about ecological organization is correct? O An organism is part of a community. O A community is part of a population. O An ecosystem is made up
7 is to 34 as 5 is to
Sides of a triangle are of the ratio 2:3:4. If the perimeter of the triangle is 90 cm, what is the area of the triangle?
Calculate the mean, median, and mode for the set 7, 9, 8, 8, 10, 9, 8, 7, 8, 6, 9, 5, 6, 8, 9, 7, 7, 8, 10, 8 please answer asap
How many electrons does maganese 55 have?
pls write a paragraph describing your family members
Given the original statement "If a number is negative, the additive inverse is positive,” which are true? Select three options.If p = a number is negative and
Find the exact value of sin(140°)cos(20°) – cos(140°)sin(20°)