1 vector<int> vect1(10); //number of elements in vector
2 int value = 0;
3 fill(vect1.begin(), vect1.end(), value);
1// Create a vector of size n with
2 // all values as 10.
3 vector<int> vect(n, 10);
1// CPP program to create an empty vector
2// and push values one by one.
3#include <vector>
4
5using namespace std;
6int main()
7{
8 // Create an empty vector
9 vector<int> vect;
10 //add/push an integer to the end of the vector
11 vect.push_back(10);
12 //to traverse and print the vector from start to finish
13 for (int x : vect)
14 cout << x << " ";
15
16 return 0;
17}