Question: Write a C program with the following specifications : Write the definition of a structure named employee that contains character array members for an employees

Write a C program with the following specifications :

Write the definition of a structure named employee that contains character array members for an employees first and last names of size 20, an int member for the employees age, a char member that contains 'M' or 'F' for the employees gender, and a double member for the

employees hourly salary.

Using the above-mentioned definition, write a C program that asks a user to enter the values of 20 employees and save them in an array of employees.

Hint: To define an array that contains 20 elements of type struct employee, you just need to write: struct employee employees[20];

Modify your program to include a function, which calculates the average salary of all employees. The function takes as input the array of all employees and returns the average salary as float value.

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!