Question: Write a C program in the following steps: (Total: 40 marks) 1- Declare following global variables: (3) - Three integers, size, min, and max. 2-

Write a C program in the following steps: (Total: 40 marks) 1- Declare following global variables: (3) - Three integers, size, min, and max. 2- Write a function prototype as follows: (3) - Name: fillarray - Return type: Nothing - Parameter: An array of integer (Only one parameter) 3- Write a function prototype as follows: (3) - Name: keepAndShowResults - Return type: Nothing - Parameter: An array of integer (Only one parameter) 4- Write the main function as follows: - Declare a counter, counter. - Ask the user to enter a positive value for counter. The input must be positive. (2) - Inside a loop - Get size, min and max. (3) - If size is invalid, set it to 5 . If min is invalid, set it to 1 . If max is invalid, set it to min+20. (3) Declare an array of integer with the given size. (2) Call function fillarray in which the array will be filled with random integers in the range of min and max, inclusive. (2) - Call the function keepAndShowResults in which the array elements, their average, as well as grand average will be printed. Grand average is the average of all the elements in all the arrays from the beginning to the current one. Note: You should only declare one array of integers inside the loop based on the size given by the user. - Show a goodbye message and exit the program. Note: Except variable counter and one integer array, you must not declare any other variable in the main function
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
