Question: Write a C program to read integers into an array and then sort the array using selection sort, where you find the smallest element in
Write a C program to read integers into an array and then sort the array using selection sort, where you find the smallest element in the array and exchange it with the first element, and then find the second smallest element and exchange it with the second element, etc., until the entire array is sorted. Have your program include four functions, besides main, which perform the following functions: 1. Read in an undetermined number of array elements 2. Print the array elements (call this function both before and after the elements are sorted) 3. Sort the array elements 4. Swap two elements of an array (this function will be called by your sort function) Which of these four functions should have the array passed in as const? Where should the local prototypes of each these functions be places? Use #define to declare the maximum array size as a constant MAXSIZE with a value of 10.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
