#includeIn this example, a QStack is created with integer elements. Three integers are pushed onto the stack, with 3 being the top element. The top element is then popped off the stack, leaving the new top element as 2. Finally, the program ends and the stack is destroyed. QStack is a package in the Qt library.#include int main() { QStack stack; stack.push(1); stack.push(2); stack.push(3); qDebug() << "top of stack: " << stack.top(); // output: 3 stack.pop(); qDebug() << "new top of stack: " << stack.top(); // output: 2 return 0; }