Sail E0 Webinar
Question


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
Options:
A .  a contains: 200 200 200 200 200b contains: 100 100 100
B .  a contains: 100 100 100 100 100b contains: 200 200 200
C .  a contains: 200 200 200 200 200b contains: 200 200 200
D .  None of the mentioned
Answer: Option A

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 ?
Next Question

Submit Solution

Your email address will not be published. Required fields are marked *

Latest Videos

Latest Test Papers