diff --git a/Stack/stack usinf array b/Stack/stack usinf array new file mode 100644 index 0000000..c11ba7e --- /dev/null +++ b/Stack/stack usinf array @@ -0,0 +1,63 @@ +#include +using namespace std; +int stack[100], n=100, top=-1; +void push(int val) { + if(top>=n-1) + cout<<"Stack Overflow"<=0) { + cout<<"Stack elements are:"; + for(int i=top; i>=0; i--) + cout<>ch; + switch(ch) { + case 1: { + cout<<"Enter value to be pushed:"<>val; + push(val); + break; + } + case 2: { + pop(); + break; + } + case 3: { + display(); + break; + } + case 4: { + cout<<"Exit"<