#includeIn this example, we create a stack of integers using the stack package library in C++. We then add four elements to the stack using the push operation: 10, 20, 30, and 40. We then use the top operation to print out the top element in the stack, which is 40. The package library used in this example is the Standard Template Library, or STL, in C++.#include int main() { std::stack myStack; myStack.push(10); myStack.push(20); myStack.push(30); myStack.push(40); std::cout << "The top element is " << myStack.top() << std::endl; return 0; }