1.

What is the output of this program?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool myfunction (int k, int L)
{
return (k==L);
}
int main ()
{
int Array[] = {101, 202, 202, 202, 303, 303, 202, 202, 101};
vector<int> num (Array, Array + 9);
vector<int> :: iterator Iter;
Iter = unique (num.begin(), num.end());
num.resize( distance(num.begin(), Iter) );
unique (num.begin(), num.end(), myfunction);
for (Iter = num.begin(); Iter != num.end(); ++Iter)
cout << ' ' << *Iter;
return 0;
}

A. 101 202 303 202 101
B. 101 202 303
C. 101 202 303 202
D. 101 202
E. 101
Answer» B. 101 202 303


Discussion

No Comment Found

Related MCQs