Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The first integer indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers.
Use C++
Write a
Ex: If the input is:
5 10 4 39 12 2
the output is:
2 4 10 12 39
For coding simplicity, follow every output value by a space, including the last one.
Your program must define and call the following function. When the SortVector function is complete, the
void SortVector(vector<int>& myVec)
Hint: There are many ways to sort a vector. You are welcome to look up and use any existing
Trending now
This is a popular solution!
Step by step
Solved in 2 steps