ExamVeda
Login
Home
C plus plus miscellaneous
?

What will be the output of the following C++ code?
#include <iostream>
#include <deque>
using namespace std;
int main ()
{
    unsigned int i;
    deque<int> a (3,100);
    deque<int> b (5,200);
    a.swap(b);
    cout << "a contains:";
    for (deque<int>::iterator it = a.begin(); it != a.end(); ++it)
        cout << ' ' << *it;
    cout << "b contains:";
    for (deque<int>::iterator it = b.begin(); it != b.end(); ++it)
        cout << ' ' << *it;
    return 0;
}

Answer & Solution
Correct Answer: Option A
Let's discuss the solution. Join the discussion
Examveda
Question posted by Examveda
Community

Join the Discussion

No comments yet Be the first to discuss this question.