Question
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
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
Answer: Option D
Was this answer helpful ?
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 ?
More Questions on This Topic :
Question 2.
What do vectors represent?
....
Submit Solution