-
What is the output of this program?
#include <iostream>
#include <deque>
using namespace std;
int main ()
{
unsigned int k;
deque<int> FirstDeque (4,125);
deque<int> SecondDeque (5,150);
FirstDeque.swap(SecondDeque);
cout << "First Data contains:";
for (deque<int>::iterator iter = FirstDeque.begin(); iter != FirstDeque.end(); ++iter)
cout << ' ' << *iter;
cout << "\nSecond Data contains:";
for (deque<int>::iterator iter = SecondDeque.begin(); iter != SecondDeque.end(); ++iter)
cout << ' ' << *iter;
return 0;
}
-
- Second Data contains: 125 125 125 125
- Second Data contains: 125 125 125 125
First Data contains: 150 150 150 150 150 - First Data contains: 150 150 150 150 150
- First Data contains: 150 150 150 150 150
Second Data contains: 125 125 125 125 - None of these
Correct Option: B
In this program, We swapped the values of both dequeues and printing the dequeues.