Question: in c++ Programming Question (1) Write a code with the following specifications: In the main function create an array with constant size of 20. (1mark)
in c++

Programming Question (1) Write a code with the following specifications: In the main function create an array with constant size of 20. (1mark) Create the following functions: o fill(int a[], int size), the function should fill the array all with random numbers between 1-100 ( use rand() function) (2 marks) o min(int a[], int size) return the minimum number in the array (2 marks) o median(Int a[], int size) return the median of the numbers in the array (2 marks) o search(Int a[], int size, Int x) find and return the index of the first appearance of value x in the array. (2 marks) o sumEvenindex(int a[], int size) return the sum of the numbers that are in the Even Indices in the array. (2 marks) o sort(Int a[], int size, int asc) sort the array ascending if asc=1, and descending otherwise. (3 marks) o reverse(int a[], int size) that changes/swap the items in the array to be in reverse order. Example: if a={2,1,7,1,5} then it should become {5,1,7,1,2). (3 marks) o oddarray (int a[], int size) this function should remove all even values from the array and keeps only the odd numbers. (3 marks) Test all functions in the main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
