Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application Development And Administration

Authors: Michael V. Mannino

4th Edition

0615231047, 978-0615231044

More Books

Students also viewed these Databases questions

Question

What are the Five Phases of SDLC? Explain each briefly.

Answered: 1 week ago

Question

How can Change Control Procedures manage Project Creep?

Answered: 1 week ago