Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <deque>
    using namespace std;
    int main ()
    {
    unsigned int k;
    deque<int> DequeData;
    DequeData.push_back (50);
    DequeData.push_back (75);
    DequeData.push_back (90);
    for(deque<int> :: iterator iter = DequeData.begin(); iter != DequeData.end(); ++iter)
    {
    }
    DequeData.clear();
    DequeData.push_back (150);
    DequeData.push_back (175);
    for(deque<int> :: iterator iter = DequeData.begin(); iter != DequeData.end(); ++iter)
    cout << ' ' << *iter;
    cout << '\n';
    return 0;
    }
    1. 50 75
    2. 75 90
    3. 90 150
    4. 150 175
    5. None of these
Correct Option: D

In this program, We cleared the old values presented in the dequeue with the new values.



Your comments will be displayed only after manual approval.