Read an integer N. This number indicates how many values the array will have.
Then, read N integers (one per line) and store them in an array.
Finally, calculate and display the total sum of all elements in the array.
Hints:
for loop to read the data and store it in the array.for loop to go through the array and accumulate the sum in a variable.An integer N, followed by N integers, one per line.
Print a single integer: the sum of all elements.
Input:
3
5
10
15
Output:
30