-
What is the output of this program?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool mygreater (int i,int j)
{
return (i > j);
}
int main ()
{
int Numbers[] = {45, 55, 55, 45, 65, 45, 55, 65};
vector<int> num(Numbers, Numbers + 8);
pair<vector<int> :: iterator, vector<int> :: iterator> Bound;
sort (num.begin(), num.end());
Bound = equal_range (num.begin(), num.end(), 65);
cout << (Bound.first - num.begin());
cout << " And " << (Bound.second - num.begin());
return 0;
}
-
- 6
- 8
- 6 And 8
- 8 And 6
- None of these
Correct Option: C
In this program, We are finding out the equal range in the vector.