adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <list>
    #include <queue>
    using namespace std;
    int main()
    {
        queue<char> q;
        q.push('a');
        q.push('b');
        q.push('c');
        cout << q.front();
        q.pop();
        cout << q.front();
        q.pop();
        cout << q.front();
        q.pop();
    }

a.

ab

b.

abc

c.

a

d.

error

Answer: (b).abc

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?