Last Updated : 10 Apr, 2024
queue <int>qe;
qe.push(3);
qe.push(4);
qe.push(6);
qe.push(5);
cout << qe.front() << \" \" << qe.size() <<endl;
qe.pop();
cout << qe.front() << \" \" << qe.size(); 

Possible outcome for the above code snippet:
(A) 3 4
4 3
(B) 3 4
4 4
(C) 3 4
3 3
(D) None of the above


Answer: (A)

Explanation:
queue queue_name: is the syntax to declare queue.
push(val): appends the val at the end of the queue.
pop(): deletes the head of the queue.
front(): returns the reference to the head of the queue.


Share your thoughts in the comments