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

(will give brainliest) What is the equation for the line?
By the end of 1960, some 70,000 demonstrators had taken part in sit-ins across the south to protest: select one: a. the vietnam war. b. the use of nuclear weapo
Anyone knows the answer to this
Add. (5x2 – 2x) + (6x – 4) A. 5x2 – 8x + 4 B. 5x2 + 4x – 4 C. 30x3 – 32x2 + 8x D. 11x2 – 6x
WILL GIVE BRAINLEST Emma created the poster shown below: A rectangle is shown. The length of the rectangle is labeled as length equal to 36 cm, and the width is
Milan is upset with his wife because she was over an hour late in picking him up at the airport. he is likely to deal most effectively with his feelings of irri
help me please someone i dont understand
Lady Bracknell. Never speak disrespectfully of Society, Algernon. Only people who can’t get into it do that. [To Cecily.] Dear child, of course you know that A
what is the volume of the cone
What was an unintended consequence of Title IX? A. Most women received lower salaries than men. B. A feminization of poverty occurred across the nation. C.