adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <algorithm>
    #include <vector>
    using namespace std;
    int main ()  
    {
        int myints[] = {10, 20, 30, 5, 15};
        vector<int> v(myints, myints + 5);
        make_heap (v.begin(), v.end());
        pop_heap (v.begin(), v.end());
        v.pop_back();
        cout << v.front() << '\n';
        return 0;
    }

a.

10

b.

20

c.

30

d.

5

Answer: (b).20

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?