Question: Write a program in C where 1. A function named loadData with a header as follows. void loadData(int arr[], int size, int min, int max),

Write a program in C where

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.

Do not use goto statement, recursion, global variables or pointers

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!