size() function is used to return the size of the vector container or the number of elements in the vector container.
using namespace std;
int main(){
vector<int> myvector{ 1, 2, 3, 4, 5 };
cout << myvector.size();
return 0;
}
//Output = 5