1.

What is the output of this program?
#include <iostream>
#include <vector>
using namespace std;
int main ()
{
vector<int> VectorData;
int add (0);
VectorData.push_back (50);
VectorData.push_back (150);
VectorData.push_back (200);
while (!VectorData.empty())
{
add += VectorData.back();
VectorData.pop_back();
}
cout << add << ' n';
return 0;
}

A. 50
B. 150
C. 200
D. 400
E. None of these
Answer» E. None of these


Discussion

No Comment Found

Related MCQs