Sail E0 Webinar
Question


What is the output of this program?


1.
#include
2.
#include
3.
using namespace std;
4.
int main ()
5.
{
6.
vector a (3, 0);
7.
vector b (5, 0);
8.
b = a;
9.
a = vector();
10.
cout
Options:
A .  10
B .  9
C .  8
D .  7
Answer: Option D

Answer:a
Explanation:In this program, We are finding the size of the vector elements.
Output:
$ g++ vect2.cpp
$ a.out
Size of a 0
Size of b 3



Was this answer helpful ?
Next Question

Submit Solution

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

Latest Videos

Latest Test Papers