1.

What is the output of this program?
 #include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
void Result(const vector<int>& VectorData)
{
for (size_t k = 0; k < VectorData.size(); ++k)
{
cout << VectorData[k] << ' ';
}
}
int main()
{
vector<int> VectorData;
VectorData.push_back(4);
VectorData.push_back(8);
sort(VectorData.begin(), VectorData.end());
Result(VectorData);
while(next_permutation(VectorData.begin(), VectorData.end()))
Result(VectorData);
return 0;
}

A. Compilation Error
B. 4 8 8 4
C. 4 8 8
D. 4 8
E. 4
Answer» C. 4 8 8


Discussion

No Comment Found

Related MCQs