1.

What is the output of this program?
#include <iostream> 
#include <algorithm>
#include <vector>
using namespace std;
int main ()
{
int FirstNum[] = {15, 100, 115, 200, 250};
int SecondNum[] = {500, 400, 300, 200, 100};
vector<int> VectorData(100);
vector<int> :: iterator Iter;
sort (FirstNum, FirstNum + 5);
sort (SecondNum, SecondNum + 5);
Iter = set_union (FirstNum, FirstNum + 5, SecondNum, SecondNum + 5, VectorData.begin());
VectorData.resize(Iter-VectorData.begin());
for (Iter = VectorData.begin(); Iter != VectorData.end(); ++Iter)
{
cout << ' ' << *Iter;
}
return 0;
}

A. 15 100
B. 15 100 115 200
C. 15 100 115 200 250 300 400 500
D. 250 300 400 500
E. 250 300
Answer» D. 250 300 400 500


Discussion

No Comment Found

Related MCQs