1.

What is the output of this program?
 #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
int main ()
{
int num[] = {15, 25, 35, 35, 25, 15, 15, 25};
vector<int> VectorData(num, num + 8);
sort (VectorData.begin(), VectorData.end());
vector<int> :: iterator Lower, Upper;
Lower = lower_bound (VectorData.begin(), VectorData.end(), 35);
Upper = upper_bound (VectorData.begin(), VectorData.end(), 35);
cout << (Lower - VectorData.begin()) << ' ';
cout << (Upper - VectorData.begin()) << ' n';
return 0;
}

A. 15 25
B. 25 15
C. 6 8
D. 8 6
E. Compilation Error
Answer» D. 8 6


Discussion

No Comment Found

Related MCQs