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

Compared to Greece, why was Persia able to organize such a massive empire
What kind of education do you need to be a paramedic?
A triangle has one side that measures 12, another side that measures x, and a third side that measures 4 less than x. The perimeter is 26. Which equation would
How many children were employed in the united states during the industrial revolution?
Rewrite 21/300 as a decimal.
I have more History
What type of insect sometimes arrives on a dead body with beetles and eats fly eggs? Ants Wasps Mites Spiders
A. experiment by purposely misconfiguring the gateway address on pc-a to 10.0.0.1. what happens when you try and ping from pc-b to pc-a? do you receive a reply?
Does each function describe exponential growth or decay?
please help me with this question. BRAINLIEST if answered.