Write code to sum the given array elements.
[1, 2, 3, 4, 5]
Sure, here's one way you could write the code using Python:

```python
def sum_array(array):
    sum = 0
    for element in array:
        sum += element
    return sum

input_array = [1, 2, 3, 4, 5] # given input
result = sum_array(input_array) # function call to sum the elements
print(f"The sum of the elements in the given array is: {result}") 
```

This code defines a function `sum_array` that takes an array as an argument and returns the sum of its elements. Inside the function, we use a for loop to iterate through each element in the array and add it to a variable `sum` which is initially set to 0. Then, we call the function with the given input array and print the result.
Complete the following task based on the instruction and optional input provided.### Instruction:
Write code to sum the given array elements.

### Input:
[1, 2, 3, 4, 5]

### Output:
Sure, here's one way you could write the code using Python:

```python
def sum_array(array):
    sum = 0
    for element in array:
        sum += element
    return sum

input_array = [1, 2, 3, 4, 5] # given input
result = sum_array(input_array) # function call to sum the elements
print(f"The sum of the elements in the given array is: {result}") 
```

This code defines a function `sum_array` that takes an array as an argument and returns the sum of its elements. Inside the function, we use a for loop to iterate through each element in the array and add it to a variable `sum` which is initially set to 0. Then, we call the function with the given input array and print the result.