Vidyalelo
C++ Programming · Q238

C++ miscellaneous

Programming · C++ Programming · question 238

Q238

What will be the output of the following C++ code? #include #include using namespace std; int main () vector a (3, 0); vector b (5, 0); b = a; a = vector (); cout << "Size of a " << int(a.size()) << ' '; cout << "Size of b " << int(b.size()) << ' '; return 0;

A.
Size of a 0
Size of b 3
Answer
B.
Size of a 3
Size of b 5
C.
Error
D.
Size of a 3
Size of b 9

Answer: Option A

Solution

Answer: Option A
No explanation is given for this question Let's Discuss on Board