From af945f52861f57ef431e80a324d238443df5201e Mon Sep 17 00:00:00 2001 From: ankitsingh999 <55996182+ankitsingh999@users.noreply.github.com> Date: Sat, 3 Oct 2020 13:44:16 +0530 Subject: [PATCH] stack in stl program to implement stack in stl --- stack in stl | 48 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 stack in stl diff --git a/stack in stl b/stack in stl new file mode 100644 index 0000000..c148239 --- /dev/null +++ b/stack in stl @@ -0,0 +1,48 @@ +#include +#include +#include +#include +using namespace std; +int main() { + stack s; + int c, i; + while (1) { + cout<<"1.Size of the Stack"<>c; + switch(c) { + case 1: + cout<<"Size of the stack: "; + cout<>i; + s.push(i); + break; + case 3: + i = s.top(); + if (!s.empty()) { + s.pop(); + cout<