Write a program that
- asks the user to enter
some numbers
- prints them out in their
original order
- sorts the numbers from
smallest to largest
- and prints them out a
second time in their sorted order.
Here is a sample execution:
You can enter up to 10 numbers.
How many do you wish to enter? 4
Enter 4 numbers.
6
7
4
5
You entered: 6 7 4 5
The numbers in order are:
4 5 6 7
Press any key to continue
Use the following functions:
fillArray - This function
-
tells the user he may enter up to 10 numbers
-
asks the user how many will be entered (count)
-
reads in the numbers and puts them into an array of int
(You
may assume the user will follow these directions.)
The
function returns count as its return value.
The
array of numbers is a parameter of the function.
displayArray - This function prints out a
numbered list of all
the
values entered by the user in their original order.
The
parameters should be both the array and the count.
sort - This function sorts the numbers from
smallest
to
greatest
main - should create an array of 10 int and
then call each of
the
other functions.
Do not use global variables.