1.

What is the output of this program?
 #include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool myfunction (int p,int q)
{
return (p < q);
}
int main ()
{
int var[] = {90, 80, 70, 60, 50};
vector<int> Num(var, var + 5);
partial_sort (Num.begin(), Num.begin() + 4, Num.end());
partial_sort (Num.begin(), Num.begin() + 4, Num.end(),
myfunction);
for (vector<int> :: iterator Iter = Num.begin(); Iter != Num.end(); ++Iter)
cout << ' ' << *Iter;
return 0;
}

A. 50 60 70 80 90
B. 50 60 70 80
C. 50 60 70
D. 50 60
E. 50
Answer» B. 50 60 70 80


Discussion

No Comment Found

Related MCQs