-
What is the output of this program?
#include <iostream>
#include <iterator>
#include <list>
using namespace std;
int main ()
{
list<int> DataList;
for (int k = 0; k < 8; k++)
DataList.push_back (k * 8);
list<int> :: iterator Iter = DataList.begin();
advance (Iter, 6);
cout << *Iter << endl;
return 0;
}
-
- Compilation Error
- 8
- Runtime Error
- 48
- None of these
Correct Option: D
In this program, We are printing the sixth element in the list.