Question
Please write , compile, run, script, and compress (to tar.gz format) the, .cfiles, and scripts of 1 program in C language. The program must prompt
Please write , compile, run, script, and compress (to tar.gz format) the, .cfiles, and scripts of 1 program in C language. The program must prompt for manual entry of any number of elements followed by a prompt to manually enter each element for any numerical array of any size. return the array size, max, min, midpoint, count less than midpoint, count greater than midpoint, the midpoint linear search, the sum, the average, the median, the number of even elements, the number of odd elements, and the number of elements divisible by the min value. Here is some source code to help start: #include #define MAX_SIZE 100 // Maximum array size int main() { int arr[MAX_SIZE]; int i, max, min, size, midpoint; /* Input size of the array */ printf("Enter size of the array: "); scanf("%d", &size); /* Input array elements */ printf("Enter elements in the array: "); for(i=0; i max) { max = arr[i]; } /* If current element is smaller than min */ if(arr[i] < min) { min = arr[i]; } } /* Print maximum and minimum element */ printf("Maximum element = %d ", max); printf("Minimum element = %d", min); printf("midpoint element = %d", midpoint); return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started