/* ========================================================================== */ /* sort.c */ /* (c) March 22, 2017 K. J. Rock */ /* */ /* Sort an array in place then */ /* sort a linked list */ /* ========================================================================== */ #include #include #include struct db // create database structure of employee data { int id; int age; float salary; }; int main() { int age = 0; // for finding the average age of the employees int count = 19; // define the number of employees for ease of change float salary = 0; // for payroll struct db temp; // temporary swap storage db employee[count]; // create a new database array called employee srand((unsigned) time(NULL)); // randomize by seeding from time // instantiate founder's info employee[0].id = 42; // ultimate answer employee[0].age = rand() % 40 + 20; // minimum age is 20 employee[0].salary = 25080.15; // instantiate the rest of the crew for (int i=1; i