Write a program that reads integer sets and
prints out the sum of the each integer set
until 0 is read. Your program starts reading
an integer N which is the number of integers
to be read as the first set, then reads N many
integers as the first integer set and prints
the sum of the N integers. The program continues
to read a second integer as the number of integers
to be read as the second set, and so on. Your program
must calculate and print the sum of the each integer
set separated by a new line.
Examples:
3
5 8 7
1
34
5
9 3 4 2 7
0
|
20
34
25
|
4
9 3 4 10
2
9 32
0
|
26
41
|
1
49
0
|
49 |
2
1 4
3
4 3 1
0
|
5 8 |
Important issues about all exams/projects/quizzes:
- Update just Question.c file, not Question.txt.
- Make changes only between the following comments(DO NOT modify these comments or anything outside the region marked by the comments):
- // == CHANGE STARTS BELOW THIS LINE ==
- // == CHANGE STOPS ABOVE THIS LINE ==
- If you modify these comments for any reason, you can copy/paste the initial version from Question.txt into Question.c. Note that Question.txt is not graded at all, so anything you write in Question.txt will be discarded.
- To avoid getting the 'Binary Not Found' error, SAVE and BUILD your code before RUN.
- Do not add any extra messages message for input/output such as 'Enter an integer:', 'The result is:', etc. Any additional text that appears in the output will cause you to get no points from the question.
- Input and output of your program must be just like those in the Examples table above.