Question: Write a C program that deal with employees salaries in a company, as follows: Define an integer array named salaries of size 100 Initialize all

  1. Write a C program that deal with employees’ salaries in a company, as follows:
    1. Define an integer array named salaries of size 100
    2. Initialize all array elements with zeros 
    3. Fill all array elements with random numbers within a range of 350 until 3000 (all inclusive) by using built-in-function rand() and srand()

Develop the following functions and call them from the main program:

  1. avgSalary(), a function that receives the array and its size as parameters and returns the average salary in the company
  2. printSalary(), a function that receives the array and its size as parameters and prints out all salaries in a tabular format each 10 salaries in same row.
  3. maxSalary(), a function that receives the array and its size as parameters and returns the highest salary in the company
  4. searchSalary(), a function that receives as parameters: the array and its size and the salary value to search for. The same function returns how many times this salary found in the array 
  5. sortSalary(),a function that receives the array and its size as parameters and sorts the array in descending order (from highest to lowest)

Step by Step Solution

3.45 Rating (158 Votes )

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 Computer Network Questions!