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

A 12-gallon tub has a faucet that lets water in at a rate of 3 gallons per minute, and a drain that lets water out at a rate of 1.5 gallons per minute. If you s
What is the factored form of [tex]x^2-36z^2[/tex]?
Find the next three terms of the sequence 80, –160, 320, –640
Someone Help please?!?!
Members of this phyla are parasites and get food from a host a.Porifera (sponges) b.Cnidarians c.Nematoda d.Platyhelminthes e.Annelida f.Echinodermata g.Mullusc
what is a fleet of warships called
What's per capita mean? (e.g. GDP per capita)
Convert 56.0 kg into pounds (lb)
Why are xylem and phloem bundled together?
What is 4 1/6 minus 2 5/6