#include<bits/stdc++.h>
using namespace std;
int main()
{
vector<int>v;
int i, n;
cout << "Enter Any Number :: ";
cin >> n;
for(i=1;i<=n;i++)
v.push_back(i);
cout << endl;
int maximum = *max_element(v.begin(), v.end());
cout << "Maximum Value is :: " << maximum << endl << endl;
int minimum = *min_element(v.begin(), v.end());
cout << "Minimum Value is :: " << minimum << endl;
return 0;
}
using namespace std;
int main()
{
vector<int>v;
int i, n;
cout << "Enter Any Number :: ";
cin >> n;
for(i=1;i<=n;i++)
v.push_back(i);
cout << endl;
int maximum = *max_element(v.begin(), v.end());
cout << "Maximum Value is :: " << maximum << endl << endl;
int minimum = *min_element(v.begin(), v.end());
cout << "Minimum Value is :: " << minimum << endl;
return 0;
}
Comments
Post a Comment