1.

What is the output of this program?
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
bool IsOdd (int k)
{
return (k % 3) == 1;
}
int main ()
{
vector<int> num;
for (int k = 1; k < 15; ++k) num.push_back(k);
vector<int> :: iterator bound;
bound = partition (num.begin(), num.end(), IsOdd);
for (vector<int> :: iterator Iter = num.begin(); Iter != bound; ++Iter)
cout << ' ' << *Iter;
return 0;
}

A. 1
B. 1 13
C. 1 13 10
D. 1 13 10 4
E. 1 13 10 4 7
Answer» F.


Discussion

No Comment Found

Related MCQs