-
What is the output of this program?
#include <iostream>
#include <deque>
using namespace std;
int main ()
{
unsigned int k;
deque<int< Data;
deque<int> :: iterator Iter;
Data.push_back ( 202 );
Data.push_back ( 303 );
Data.push_back ( 404 );
for (Iter = Data.begin(); Iter != Data.end(); ++Iter)
Data.clear();
cout << ' ' << *Iter;
}
-
- 202
- 303
- 404
- Segmentation fault
- None of these
Correct Option: D
Errors will arise because we are clearing all the queue values before printing it.