Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Program in C that contains the following 3 functions: Please do not use goto statement, global variable or recursive function. The output should
Write a Program in C that contains the following 3 functions:
Please do not use goto statement, global variable or recursive function.
The output should print as follows
1. A function named loadData with a header as follows. void loadData (int arr[], int size, int min, int max), where size is the number of integers in arr. The function assigns to each element in arr a random integer between min and max inclusive, and prints each element. 2. A function named printBigNumbers that has two parameters, an array of integers and an integer that represents the number of integers in the array. The function first calculates and prints the average (formatted to 2 decimal places) of all the integers in the array, then prints and counts big integers that are greater than the average, and finally returns the number of big integers. 3. The main function that does the followings. Keep reading two integers namely min and max from the user, until min is less than max. Print a message when the input is invalid. Then, define an array of 5 integers, call function loadData with the array, its size, min and max. Finally, call the function printBigNumbers and print the returned value. . Enter min and max: 8 8 : Invalid input. Enter min and max: -5 5 In function 1, all integers in array: -1 3-5 -4 -5 In function 2, average is: -2.40 In function 2, big integers greater than average: -1 3 In main function, number of big integers: 2Step 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