What output is displayed after the following segment of code executes: stack s; int a = 22,
Fantastic news! We've Found the answer you've been seeking!
Question:
What output is displayed after the following segment of code executes:
stack s;
int a = 22, b = 44;
s.push(2);
s.push(a);
s.push(a + b);
b = s.top();
s.pop();
s.push(b);
s.push(a - b);
s.pop();
while (!s.empty()) {
cout << s.top() << endl;
s.pop();
}
A
2 22 66 |
B | 66 22 2 |
C 44 22 2 |
D 44 22 66 |
Related Book For
Posted Date: