adplus-dvertising
frame-decoration

Question

What is the output of this program?
    #include <iostream>
    #include <stack>
    using namespace std;
    int main ()
    {
        stack<int> mystack;
        mystack.push(10);
        mystack.push(20);
        mystack.top() -= 5;
        cout << mystack.top() << endl;
        return 0;
    }

a.

10

b.

20

c.

13

d.

15

Answer: (d).15

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?