Question: 4.9 (Sum a Sequence of Integers ) Write a program that sums a sequence of integers . Assume that the first integer read with scanf
4.9 (Sum a Sequence of Integers ) Write a program that sums a sequence of integers . Assume that the first integer read with scanf specifies the number of values remaining to be entered. Your program should read only one value each time scanf is executed. A typical input sequence might be: 5 100 200 300 40 500 where the 5 indicates that the subsequent five values are to be summed. (In this example, the result should be 1500.)
Sample Run:
Entersequencesize:5
Enteryourvalue:100
Enteryourvalue:200
Enteryourvalue:300
Enteryourvalue:400
Enteryourvalue:500
Thesumofthesequenceis:1500
(In C language, please)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
