C++ Arrays (Sum of array) | Set 1
School Accuracy: 47.78% Submissions: 12141 Points: 0

Given an array of N integers. Your task is to print the sum of all of the integers.

Input:
First line of input file contains a single integer T which denotes the number of test cases. For each test case, there will be two lines. First line contains N which denotes number of elements in an array, and second line contains N space seperated integers.

Output:
Corresponding to each test case, print the sum of array in a new line.

Constraints:
1 <= T <= 100
1 <= N <= 1000

0 <= Arr[i] <= 200

Example:
Input:
2
4
1 2 3 4
6
5 8 3 10 22 45

Output:
10
93

 

to report an issue on this page.

Editorial

We strongly recommend solving this problem on your own before viewing its editorial. Do you still want to view the editorial?

Yes

All Submissions

My Submissions:

Login to access your submissions.

Output Window