Q214
What will be the output of the following C++ code? #include #include using namespace std; int main () vector myvector; int sum (0); myvector.push_back (100); myvector.push_back (200); myvector.push_back (300); while (!myvector.empty()) sum += myvector.back(); myvector.pop_back(); cout << sum << ' '; return 0;
A.
500
B.
600
AnswerC.
700
D.
Error
Answer: Option B
Solution
Answer: Option B
No explanation is given for this question Let's Discuss on Board