1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Evgen [1.6K]
3 years ago
6

Write a program that gets a list of integers from input, and outputs the integers in ascending order (lowest to highest). The fi

rst integer indicates how many numbers are in the list. Assume that the list will always contain less than 20 integers.
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 SortArray function is complete, the vector passed in as the parameter should be sorted. void SortVector(vector& myVec)
Computers and Technology
1 answer:
kozerog [31]3 years ago
7 0

Answer:

see explaination

Explanation:

#include <iostream>

#include <vector>

using namespace std;

void vector_sort(vector<int> &vec) {

int i, j, temp;

for (i = 0; i < vec.size(); ++i) {

for (j = 0; j < vec.size() - 1; ++j) {

if (vec[j] > vec[j + 1]) {

temp = vec[j];

vec[j] = vec[j + 1];

vec[j + 1] = temp;

}

}

}

}

int main() {

int size, n;

vector<int> v;

cin >> size;

for (int i = 0; i < size; ++i) {

cin >> n;

v.push_back(n);

}

vector_sort(v);

for (int i = 0; i < size; ++i) {

cout << v[i] << " ";

}

cout << endl;

return 0;

}

You might be interested in
Write a C++ program that would take 10 integers and outputs mean, median, and range. Create at least three functions: one for so
Ksenya-84 [330]
Yes c is correct because yeah i said so
5 0
3 years ago
Cheng, a student, is researching a company's profile on a professional networking website. In what way will this kind of researc
vlada-n [284]

The way that this kind of research benefit her is by upgrading her knowledge.

<h3>What is research?</h3>

Research is known to  be a kind of making of new knowledge through the use of (or not) of previous knowledge in a novae and creative way.

Note that The way that this kind of research benefit her is by upgrading her knowledge as it will help her to have and get new concepts, methodologies and also have good understandings.

Learn more about research  from

om/question/968894

#SPJ1

5 0
2 years ago
What are the buisness debts called?
inessss [21]
Business debts are called:
B. Liabilities
4 0
4 years ago
Question #2
Otrada [13]

Answer:

print debugging

Explanation:

6 0
3 years ago
A leading pharmaceutical company is launching a major transformation of its entire Cloud operations in order to more quickly and
klasskru [66]

This is a great move for the Pharmaceutical company for a number of reasons.

  • The first and perhaps most important advantage is to the company is that costs relating to Information and Technology (IT) Infrastructure will be reduced to the barest minimum. As a start-up, it is important to keep costs as low as possible. Costs are kept low because the organization will not need to pay the added energy and personnel-related costs of maintaining an elaborate IT infrastructure.

  • The advantage of scalability. Scalability in this sense simply means the ability to take on additional workload or adjust to market demand. As the company grows and attracts more clients, it would need to expand beyond the capacity that it had at the onset. Opting for Cloud as a Service (CaaS) gives them this advantage.

  • Another way CaaS can help the client is that they enjoy the advantage of Business Continuity. Business Continuity is the ability to remain in business regardless of disruptions to the business itself at one location. This is because CaaS providers are structured in such a way that they are able to keep their subscribers in operation regardless of any disasters.

Other advantages to this client are:

  1. Ease and access of automatic updates to the system;
  2. Ease of collaboration between internal and external users of the same system.

Learn more about the merits of Cloud as a Service here:

brainly.com/question/24705780

4 0
2 years ago
Other questions:
  • When computer manufacturers overcame the enormous 13,000 Chinese character barrier by creating a workable keyboard through voice
    15·1 answer
  • Which type of natural hazard is sometimes caused by human activity?
    6·1 answer
  • Media applications that play audio or video files are part of a class of workkloads called "streaming" workloads (i.e., they bri
    9·1 answer
  • Open IDLE. Create a new script file (File--&gt;New File, Ctrl n on Windows, Cmd n on macOS). On the first line, place your name
    6·1 answer
  • What are some specific ways that businesses use the internet?
    6·2 answers
  • #include
    12·1 answer
  • Use the drop-down menus to complete the steps to convert a macro to VBA.
    8·1 answer
  • My Macbook computer charger is burned from the side od the cord. -_- Great way to start school. Anything i should do?
    15·2 answers
  • What is a zerø-day exploit? No go.ogle &gt;:(
    10·1 answer
  • What does a companys code of ehtics cover
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!