-
What is the output of this program?
#include <iostream>
#include <stack>
using namespace std;
int main ()
{
stack<int> StackData;
StackData.push(25);
StackData.push(45);
StackData.top() -= 5;
cout << StackData.top() << endl;
return 0;
}
-
- 45
- 25
- 5
- Compilation Error
- None of these
Correct Option: A
In this program, We used top option and this will return the reference to the next element.