From da1644e7c84e5db973535ea5c9421c290843e89e Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 22 Sep 2024 12:37:40 -0500 Subject: [PATCH] Lab 1 done --- Q1.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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