#include<bits/stdc++.h>
using namespace std;
int main()
{
int n, m;
cout << "Enter Array Size :: ";
cin >> n;
int a[n];
cout << "\nEnter Array Element :: ";
for(int i=0;i<n;i++)
cin >> a[i];
cout << "\n";
if(is_sorted(a, a+n))
cout << "Array is Sorted." << "\n";
else
cout << "Array is not Sorted." << "\n";
cout << "\nEnter Vector Size :: ";
cin >> m;
vector<int>v(m);
cout << "\nEnter Vector Element :: ";
for(int i=0;i<m;i++)
cin >> v[i];
cout << "\n";
if(is_sorted(v.begin(), v.end()))
cout << "Vector is Sorted." << "\n";
else
cout << "Vector is not Sorted." << "\n";
return 0;
}
Comments
Post a Comment