- The program is hard coded to only work with arrays of 10 numbers. Add a consta
ID: 3788171 • Letter: #
Question
- The program is hard coded to only work with arrays of 10 numbers. Add a constant called size before main that is assigned the number of elements to be sorted. Use this size constant in the rest of the program so that the sort will work for any number of values. Run your program with size equal to 12 (add 2 more numbers to the array in its declaration list). -
- A simple change to the program will sort the numbers from largest to smallest. Change your program so that it does this. Do not print the sorted values in reverse order! Actually change the sort.
Explanation / Answer
I have added size constant in the rest of the program and also made a change in the program such that now the program will sort from largest to smallest and also made the array with 12 elements
Here is the code:
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.