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

kedar earns a monthly salary of $2,200 plus a 3.75% commission on the amount of his sales at a mens clothing store. what would he earn this month if he sold $4,
Kids, wanting to follow in the footsteps of the clowning icon, approaches him for guidance. How should the sentence above be rewritten to correct the subject-ve
Why is the word “Cherokee” capitalized in the following sentence?
Which explorers circumnavigated the globe
The process of making changes in the DNA code of a living organism is called a. selective breeding. c. inbreeding. b. genetic engineering. d. hybridization.
What is an Abrafile used for?
What was the most important result of the Land Ordinance of 1785?
Evidence of more sophisticated religious beliefs includes _____. buildings constructed for public purposes placement of human remains crosses on buildings embal
If I was 14 stone what would my gravity be on venus
how many times does 4 go into 315