Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<stack>
- using namespace std;
- stack<int>st;
- int main()
- {
- st.push(1);
- st.push(2);
- st.push(3);
- st.push(4);
- st.pop(); // 4 delete হয়ে গিয়েছে ।
- cout<<st.top()<<endl; // stack এর top value এখন 3 ।
- cout<<"\nPrinting remaining values of stack :\n\n";
- while(!st.empty())
- {
- cout<<st.top()<<endl;
- st.pop();
- }
- // এখানে empty() ফাংশনটি স্ট্যাক খালি হয়েছে কিনা তা check করে ।
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment