// Pantea Aria // Implementation file for the array_functions module #include #include "array_functions.h" // Reads integers into the given array // Assumes valid input void read_array(int size, int array[]) { for (int i = 0; i < size; i++) { scanf("%d", &array[i]); } } // Prints all integers in the given array void print_array(int size, int array[]) { for (int i = 0; i < size; i++) { printf("%d ", array[i]); } printf("\n"); } // Finds and returns the minimum value in the array int find_minimum(int size, int array[]) { int min = array[0]; for (int i = 1; i < size; i++) { if (array[i] < min) { min = array[i]; } } return min; } // Returns the sum of all elements in the array int sum_array(int size, int array[]) { int total = 0; for (int i = 0; i < size; i++) { total += array[i]; } return total; }