#include #include // vector is included #include using namespace std; int main() { vector v { // vector 10, 20, 30 }; // Adding a 4th end to the vector and a 5th v.push_back(40); v.push_back(50); cout << "This vector contains these set values of:\n"; // Printing the statements for (size_t i = 0; i < v.size(); ++i) { cout << "v[" << i << "] = " << v[i] << "\n"; } // The sum of elements int sum {0}; for (int x : v) { sum += x; } cout << "Sum of elements = " << sum << "\n"; return EXIT_SUCCESS; }