Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <algorithm>
    #include <vector>
    using namespace std;
    int main ()
    {
    int num[] = {3, 5, 7, 9, 11};
    vector<int> VectorData(num, num + 6);
    make_heap (VectorData.begin(),VectorData.end());
    cout << VectorData.front() << '\n';
    return 0;
    }
    1. 11
    2. 3
    3. 5
    4. 7
    5. 9
Correct Option: A

In this program, We are printing the maximum value in the heap.



Your comments will be displayed only after manual approval.