#include #include using namespace std; int main() { // Empty stack stack mystack; mystack.push(0); mystack.push(1); mystack.push(2); // Printing content of stack while (!mystack.empty()) { cout << ' ' << mystack.top(); mystack.pop(); } } O/P= 2 1 0 Note that output is printed on the basis of LIFO propertyEg Input : mystack = 0, 1, 2mystack.pop(); Output : 0, 1Input : mystack = 0, 1, 2, 3, 4, 5mystack.pop(); Output : 0, 1, 2, 3, 4