Question #312381

Write a C++ program that will accept an input for the array size. Store the user input and sort array elements in ascending order.

Expert's answer

Here is program:

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main()
{
	int size;
	cin >> size;
	vector<int> arr(size);
	sort(begin(arr), end(arr));
}
LATEST TUTORIALS
APPROVED BY CLIENTS