-
What is the output of this program?
#include <iostream>
#include <iterator>
#include <vector>
using namespace std;
int main ()
{
vector<int> NewVector;
for (int k = 1; k < 6; ++k)
NewVector.push_back(k * 10);
ostream_iterator<int> out_it (cout,", ");
copy ( NewVector.begin(), NewVector.end(), out_it );
return 0;
}
-
- 10,
- 10, 20,
- 10, 20, 30,
- 10, 20, 30, 40,
- 10, 20, 30, 40, 50,
Correct Option: E
In this program, We are producing the values by vector and printing it by using ostream iterator.