1.

What is the output of this program?
#include <iostream>
#include <memory>
#include <algorithm>
using namespace std;
int main ()
{
int num[] = {11, 15, 14, 15, 14, 11};
pair <int*, ptrdiff_t> Res = get_temporary_buffer<int>(6);
if (Res.second > 0)
{
uninitialized_copy (num, num + Res.second, Res.first);
sort (Res.first, Res.first + Res.second);
for (int k = 0; k < Res.second; k++)
cout << Res.first[k] << " ";
return_temporary_buffer (Res.first);
}
return 0;
}

A. 11 11
B. 11 11 14
C. 11 11 14 14 15 15
D. 14 15 15
E. 14 15
Answer» D. 14 15 15


Discussion

No Comment Found

Related MCQs