220k views
2 votes
Program that take 3 number and display them in ascending order c++

User Filbert
by
5.1k points

1 Answer

4 votes

Answer:

#include <iostream> // std::cout

#include <algorithm> // std::sort

#include <vector> // std::vector

using namespace std;

int main()

{

vector<int> myvector{ 8, 1, 3 };

std::sort(myvector.begin(), myvector.end());

for (int x : myvector)

cout << x << " ";

}

Step-by-step explanation:

Use STL libraries where you can to keep your code robust!

User Frank Van Eykelen
by
5.4k points