#include <bits/stdc++.h>
using namespace std;
int main()
{
vector<int>::const_iterator iter;
int limit, input;
vector<int> v;
cout << " Enter the limit : ";
cin >> limit;
cout << "Enter the numbers for array :\n ";
for (int i = 0; i < limit; i++)
{
cin >> input;
}
v.push_back(input);
cout << "Sorting the array :\n";
sort(v.begin(), v.end());
cout << "Array numbers :\n";
/* for (iter = v.begin(); iter != v.end(); ++iter)
cout << *iter << endl;*/
for (int i = 0; i < limit; i++)
{
cout << v[i] << " ";
}
}
I want the vector array input from user and to sort and display it and also provide the comment from which i can understand the problem and will not make the mistakes twice
Thank You