Question
Design a program that generates the sum of numbers.
Given a number (user input) you need an application that will produce a sum of the numbers from 1 to that given number
Given a number (user input) you need an application that will produce a sum of the numbers from 1 to that given number
Answers
Steve
read n
sum=0
for (i=1 to n) sum += i
sum=0
for (i=1 to n) sum += i