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

rewrite 3/10 and 7/25 so that they have a common denominator.
Solve for c. 2abc + d = 3
What metric unit of length would you use to measure the width of a computer screen? A; mm B; cm C; m D; km
Which are the solutions of the quadratic equation? x2 = 7x + 4
Where are the 2018 winter olympics being held?
How long is the border between california and mexico?
How old was albert einstein when he moved to america?
Protists and bacteria are grouped into different domains because
The triangular prism has a volume of 27 cubic units. What will be the volume of the prism if each side is dilated by a factor 1/3 1 cubic unit, 3,8,9
What factors prompted President Lincoln to change his mind and issue the Emancipation Proclamation?