From 75f3b2d344783f34f2a2682990b4fd027a131ffa Mon Sep 17 00:00:00 2001 From: Divyanshu Bisht <57855321+divyanshubisht@users.noreply.github.com> Date: Tue, 9 Feb 2021 17:45:57 +0530 Subject: [PATCH] Create stacks using static array.cpp --- .../stacks using static array.cpp | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 Stacks_Using_Queues/stacks using static array.cpp diff --git a/Stacks_Using_Queues/stacks using static array.cpp b/Stacks_Using_Queues/stacks using static array.cpp new file mode 100644 index 0000000000..d2b33e8050 --- /dev/null +++ b/Stacks_Using_Queues/stacks using static array.cpp @@ -0,0 +1,53 @@ +#include +using namespace std; + +class stack +{ +private: + int top; +public: + stack() + { + top=-1; + } + int arr[10]; + void push(int n) + { + if(top>=10-1) + { + cout<<"stack overflow"<