Question
1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
unsigned int i;
7.
deque a (3,100);
8.
deque b (5,200);
9.
a.swap(b);
10.
cout
What is the output of this program?
1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
unsigned int i;
7.
deque a (3,100);
8.
deque b (5,200);
9.
a.swap(b);
10.
cout
Answer: Option A
Was this answer helpful ?
In this program, We swapped the values of both dequeues and printing the dequeues.
Output:
$ g++ seq1.cpp
$ a.out
a contains: 200 200 200 200 200b contains: 100 100 100
Was this answer helpful ?
Submit Solution