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

In a museum, the ratio of adults to children is 4 to 14. if there are 360 people in the museum, how many children are there?
A total of 294 tickets were sold for the school play. They were either adult tickets or student tickets. The number of student tickets sold was two times the nu
Who eventually replaced chinese workers, especially in agriculture, after the chinese exclusion act?
The ______ secretes salts, acids, and enzymes, which continue the breakdown of proteins, fats, and carbohydrates.
22 pounds per day is how many ounces per hour?
while getting w beaker from the shelf, robert dropped the beaker and it broke. what should robert do first
what is the best way to start a personal essay?
The slope of the equation in the picture
Discuss ancient peoples’ strategies for surviving in the varied climates of north america. how did their different approaches to survival contribute to the dive
there is a 20% discount with a set of tires in normally sells for $368. How much will be tires cost after the discount?