-
What is the output of this program?
#include <iostream>
#include <vector>
using namespace std;
int main ()
{
vector<int> VectorData (5);
for (unsigned k = 0; k < VectorData.size(); k++)
VectorData.at(k) = k;
for (unsigned k = 0; k < VectorData.size(); k++)
cout << ' ' << VectorData.at(k);
return 0;
}
-
- 0 1 2 3 4
- 0 1 2 3
- 0 1 2
- 0 1
Correct Option: A
In this program, We are pushing the values into the vector from 0 to 5 by using for loop.