Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <vector>
    using namespace std;
    int main ()
    {
    vector v;
    v.push_back(false);
    v.flip();
    cout << boolalpha;
    for (unsigned k = 0; k < v.size(); k++)
    cout << v.at(k);
    return 0;
    }
    1. false
    2. True
    3. Compilation Error
    4. Runtime Error
    5. None of these
Correct Option: B

In this program, We are flipping the vector values by using flip function.



Your comments will be displayed only after manual approval.