1 int arr[]= {2,3,5,6,1,2,3,6,10,100,200,0,-10};
2 int n = sizeof(arr)/sizeof(int);
3 sort(arr,arr+n);
4
5 for(int i: arr)
6 {
7 cout << i << " ";
8 }
9
1// C++ program to sort a vector in non-decreasing
2// order.
3#include <bits/stdc++.h> // Vector
4#include <algorithm> // Sort
5using namespace std;
6
7int main()
8{
9// Initalizing the vector v with these values
10 vector<int> v{ 1, 5, 8, 9, 6, 7, 3, 4, 2, 0 };
11// Vector is sorted in ascending order
12 sort(v.begin(), v.end());
13
14 return 0;
15}