Vidyalelo
C++ Programming · Q392

C++ miscellaneous

Programming · C++ Programming · question 392

Q392

What will be the output of the following C++ code? #include #include #include using namespace std; int main () int numbers[] = 1, 5, 4, 5; pair result = get_temporary_buffer (4); if (result.second > 0) uninitialized_copy (numbers, numbers + result.second, result.first); sort (result.first, result.first + result.second); for (int i = 0; i < result.second; i++) cout << result.first[i] << " "; return_temporary_buffer (result.first); return 0;

A.
1 5 5 4
B.
5 5 4 1
C.
1 4 5 5
Answer
D.
1 4 5 2

Answer: Option C

Solution

Answer: Option C
No explanation is given for this question Let's Discuss on Board