adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <deque>
    using namespace std;
    int main ()
    {
        unsigned int i;
        deque<int> mydeque;
        mydeque.push_back (100);
        mydeque.push_back (200);
        mydeque.push_back (300);
        for(deque<int> :: iterator it = mydeque.begin(); it != mydeque.end(); ++it)
        {
        }
        mydeque.clear();
        mydeque.push_back (110);
        mydeque.push_back (220);
        for(deque<int> :: iterator it = mydeque.begin(); it != mydeque.end(); ++it)
            cout << ' ' << *it;
        cout << '\n';
        return 0;
    }

a.

110

b.

220

c.

Both 110 & 220

d.

None of the mentioned

Answer: (c).Both 110 & 220

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?