Home » C++ Programming » Questions and Answers » Question
  1. What is the output of this program?
    #include <iostream>
    #include <queue>
    using namespace std;
    int main ()
    {
    queue<int> QueueData;
    QueueData.push(15);
    QueueData.push(45);
    QueueData.back() -= QueueData.front();
    cout << QueueData.back() << endl;
    return 0;
    }
    1. 15
    2. 45
    3. 30
    4. Compilation Error
    5. None of these
Correct Option: C

In this program, We used the queue operation and performed the back operation. Because of that operation, We got the output as 30.



Your comments will be displayed only after manual approval.