I can't seem to get this code to run and I need to know the output. Can some one please help me?
vector<int> myinventory(4);
myinventory[0] = 2;
for (int i = 1; i <= 3; i++)
{
myinventory[i] = 2*myinventory[i -1];
}
myinventory.push_back(34);
for (int i = 0; i < myinventory.size(); i++)
{
cout << myinventory[i]<< " ";
}
Please, if you can provide the output that would be great.