Q289
What will be the output of the following C++ code? #include #include #include using namespace std; bool myfunction (int i,int j) return (i myvector (myints, myints + 5); partial_sort (myvector.begin(), myvector.begin() + 3, myvector.end()); partial_sort (myvector.begin(), myvector.begin() + 2, myvector.end(), myfunction); for (vector :: iterator it = myvector.begin(); it != myvector.end(); ++it) cout << ' ' << *it; return 0;
A.
5 6 7
B.
5 6 7 9 8
AnswerC.
9 8 7 6 5
D.
8 5 6 7 4
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board