#include using namespace std; template class stack { public: int stacksize,top; T *astack; stack(int size) { stacksize=size; astack=new T[stacksize]; top=-1; } int isempty() { if(top==-1) { return 1; } else { return 0; } } int isfull() { if(top==stacksize-1) { return 1; } else { return 0; } } void push(T item) { if(isfull()) { cout<<"stack is full\n"; } else { top=top+1; astack[top]=item; } } T pop() { if(isempty()) { cout<<"stack is empty\n"; } else { T val; val=astack[top]; top=top-1; cout<<"the value is\t"<s1(5); do { cout<<"1-push\n2-pop\n3-exit\n"; cout<<"enter your choice\n"; cin>>ch; switch(ch) { case 1:cout<<"enter the value\n"; cin>>val; s1.push(val); break; case 2: s1.pop(); break; } }while(ch!=3); }