- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path005stack.cpp
More file actions
Latest commit
17 lines (15 loc) · 464 Bytes
/
Copy path005stack.cpp
File metadata and controls
17 lines (15 loc) · 464 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include<iostream>
#include<stack>
usingnamespacestd;
// stack = last in first out
intmain(){
stack<string> s;
s.push("ashish");
s.push("anil");
s.push("waykar");
cout <<"Top Element -> "<<s.top()<<endl;
s.pop();
cout <<"Top Element -> "<<s.top()<<endl;
cout<<"Size Of Stak -> "<<s.size()<<endl;
cout<<"Empty Or Not -> "<<s.empty()<<endl;// 0 == false stack is not empty & 1 == true the stack is empty
}