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
- 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 array elements with zeros
- 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:
- avgSalary(), a function that receives the array and its size as parameters and returns the average salary in the company
- 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.
- maxSalary(), a function that receives the array and its size as parameters and returns the highest salary in the company
- 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
- 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
Get step-by-step solutions from verified subject matter experts
