adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <iterator>
    #include <list>
    using namespace std;
    int main () 
    {
        list<int> mylist;
        for (int i = 0; i < 10; i++) 
        mylist.push_back (i * 10);
        list<int> :: iterator it = mylist.begin();
        advance (it, 5);
        cout  << *it << endl;
        return 0;
    }

a.

30

b.

40

c.

50

d.

60

Answer: (c).50

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What is the output of this program?