static int Sum(int[] values) { int total = 0; for (int index = 0; index <= values.Length; index++) { total += values[index]; } return total; }