#include<iostream>
using namespace std;
int arr[4];
int top=-1;
class stack
{
public:
void create(int v)
{
cout<<"Push : "<<v<<"From "<<top<<endl;
arr[top]=v;
}
void pop()
{
cout<<"POP : "<<arr[top]<<endl;
}
void empty()
{
if(top==-1)
{
cout<<"Stack is empty"<<endl;
}
}
void isfull()
{
if(top<=5)
{
cout<<"Stack is Full"<<endl;
}
else
{
cout<<"Stack is not full"<<endl;
}
}
};
int main()
{
stack obj;
int choice,v;
while(true)
{
cout<<"\nEnter [Link] Push"<<endl;
cout<<"Enter [Link] pop"<<endl;
cout<<"Enter [Link] Display"<<endl;
cout<<"Enter [Link] empty "<<endl;
cout<<"Enter [Link] full"<<endl;
cin>>choice;
switch(choice)
{
case 1:
if(top<5)
{
cout<<"Enter value"<<endl;
cin>>v;
top++;
[Link](v);
break;
}
else
{
cout<<"List is Full"<<endl;
}
break;
case 2:
if(top>-1)
{
top--;
[Link]();
break;
}
else
{
cout<<"List is Empty"<<endl;
}
case 3:
for(int i=0;i<=top;i++)
{
cout<<arr[i]<<" ";
}
break;
case 4:
[Link]();
break;
case 5:
[Link]();
break;
}
}
}