-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSource.cpp
More file actions
43 lines (34 loc) · 657 Bytes
/
Source.cpp
File metadata and controls
43 lines (34 loc) · 657 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#include<iostream>
#include"Header.h"
using namespace std;
int main()
{
Mystack<int> s;
s.Push(5);
s.Push(4);
s.Push(3);
s.Push(2);
s.Push(1);
s.Print();
cout << endl<< "Size of Stack is: " << s.Size() << endl;
s.Pop();
s.Pop();
s.Print();
cout << endl << "Size of stack is: " << s.Size() << endl;
int D;
s.Top(D);
cout <<"Top element is: " << D << endl;
if (s.isEmpty() == true)
cout << "Stack is empty" << endl;
else
cout << "Stack is not empty" << endl;
s.Pop();
s.Pop();
s.Pop();
if (s.isEmpty() == true)
cout << "Stack is empty" << endl;
else
cout << "Stack is not empty" << endl;
system("Pause");
return 0;
}