diff --git a/Q1.c b/Q1.c index ac577a4..087243e 100644 --- a/Q1.c +++ b/Q1.c @@ -1,8 +1,9 @@ #include // Question 1: + // Function to find maximum -int find_maximu m(const int arr[], int len) { +int find_maximum(const int arr[], int len) { int max = arr[0]; for(int i = 0; i < len; i++) { if(arr[i] > max) { @@ -11,7 +12,6 @@ int find_maximu m(const int arr[], int len) { } return max; } - // Function to find minimum int find_minimum(const int arr[], int len) { int min = arr[0]; @@ -22,7 +22,6 @@ int find_minimum(const int arr[], int len) { } return min; } - // Function to find amount temperatures above given threshold int above_threshold(const int arr[], int len, int threshold) { int count = 0; @@ -32,7 +31,6 @@ int above_threshold(const int arr[], int len, int threshold) { } return count; } -// Passed arrays are const because they shouldn't be modified in the functions int main() { // The array of temps, and threshold value to be used to test