PROGRAMMING:Using foreach to find the sum of arrays
Define an integer array a, the length of the array is given by keyboard, and use foreach statement to find the sum of all elements of the array.
###Input format:
Enter the length of the array on the first line
The second line gives the values of each element of the array, separated by spaces
###Output format:
Value of output sum
###Input example:
Here is a set of inputs. For example:
```in
five
1 2 3 4 5
```
###Output example:
The corresponding output is given here. For example:
```out
fifteen
```
answer:If there is no answer, please comment
###Input format:
Enter the length of the array on the first line
The second line gives the values of each element of the array, separated by spaces
###Output format:
Value of output sum
###Input example:
Here is a set of inputs. For example:
```in
five
1 2 3 4 5
```
###Output example:
The corresponding output is given here. For example:
```out
fifteen
```
answer:If there is no answer, please comment