1#include <bits/stdc++.h>
2#include <vector>
3using namespace std;
4
5int main()
6{
7// This vector initializes with the values: 10, 20, and 30
8 vector<int> vect{ 10, 20, 30 };
9
10 return 0;
11}
1// CPP program to create an empty vector
2// and push values one by one.
3#include <bits/stdc++.h>
4using namespace std;
5
6int main()
7{
8 int n = 3;
9
10 // Create a vector of size n with
11 // all values as 10.
12 vector<int> vect(n, 10);
13
14 for (int x : vect)
15 cout << x << " ";
16
17 return 0;
18}
19