hajiramansoor139 hajiramansoor139
  • 18-11-2020
  • Computers and Technology
contestada

Program that take 3 number and display them in ascending order c++

Respuesta :

tonb
tonb tonb
  • 18-11-2020

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 << " ";

}

Explanation:

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

Answer Link

Otras preguntas

Mrs. Whatsit and the children name well-known figures from our civilization who have fought against the darkness. Whom would you add to the list?
how to calculate square root?
The study of which cultures profoundly changed the culture and art of europe in the 13th and 14th centuries?
Why is it necessary to re-circularize a plasmid prior to transformation into cells?
find the length of each petal of the polar curve r=4+2cos3 theta
What is the main advantage of being a sole proprietorship
The accuplacer tests cover all of the following except: A. Reading B. Math C. English D. Science
What were the military impacts of WW2 on the US?
In the united states and canada, which general region has been losing population?
Reuben has recently taken up weight lifting and his friends at the gym mistakenly believe they should eat more protein to build muscle. the dri for protein for