#include #include #include #define MAX_SIZE 100 class Stack { private: int arr[MAX_SIZE]; int top; public: Stack() { top=-1; } void push(int); int pop(); void display(); }; void Stack::push(int data) { if(top>=MAX_SIZE-1) cout<<"Stack Overflow"; else { top++; arr[top]=data; } } int Stack::pop() { if(top==-1) { cout<<"Stack Underflow\n"; return 0; } else { int x=arr[top]; top--; return x; } } void Stack::display() { cout<<"The Stack is :\n"; for(int i=top;i>=0;i--) { cout<>choice; switch(choice) { case 1: int data; cout<<"Enter the element to be pushed: "; cin>>data; stack.push(data); break; case 2: cout<<"The Popped element is: " << stack.pop(); break; case 3: stack.display(); break; case 0: exit(0); } } }