Question PRG-CPP-0050
MediumWhat is the output of this program?
#include <iostream>
#include <stack>
#include <queue>
using namespace std;
int main() {
stack<int> s;
queue<int> q;
for (int i = 1; i <= 3; i++) { s.push(i); q.push(i); }
cout << s.top() << q.front() << q.back();
return 0;
}
- A.
313
- B.
131
- C.
Sign up free to see the answer and a step-by-step explanation.