From f813c3de4be15df23eb1c456664bf76d19b5514e Mon Sep 17 00:00:00 2001 From: Ajinkya6811 <85946002+Ajinkya6811@users.noreply.github.com> Date: Mon, 31 Oct 2022 13:16:42 +0530 Subject: [PATCH] Create stack usinf array --- Stack/stack usinf array | 63 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 Stack/stack usinf array 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"<