Stack program through class

c++

#include<iostream>
#define size 50
class data_stack
{
private:
int stack[size],top;
public:
data_stack()
{
top=-1;
}

int underflow()
{
if(top==-1)
{
cout<<“Stack is empty”<<endl;
return(1);
}
else
{
return(0);
}
}

int overflow()
{
if(top==size-1)
{
cout<<“Stack is full”<<endl;
return(1);
}
else
{
return(0);
}
}

void push(int item)
{
if(overflow()==0)
{
top=top+1;
stack[top]=item;
}
}

void pop()
{
if(underflow()==0)
{
top=top-1;
}
}

void display()
{
int i;
if(top==-1)
{
cout<<“\nNo Data are available.\n”;
}
else
{
for(i=top;i>-1;i–)
{
cout<<“Element at Position “<<i<<“: “<<stack[i]<<endl;
}
}
}

}; // end of class stack
int main()
{
data_stack q;
int choice=1,item;
while(choice!=4)
{
cout<<“************MENU**************”<<endl;
cout<<“1. Push into the stack”<<endl;
cout<<“2. Pop from stack”<<endl;
cout<<“3. Display”<<endl;
cout<<“4. Exit”<<endl;
cout<<“\nEnter your choice: “<<endl;
cin>>choice;
switch(choice)
{
case 1:
{
cout<<“Enter the item tobe pushed: “<<endl;
cin>>item;
q.push(item);
cout<<“After push operation stack is:”<<endl;
q.display();
break;
}

case 2:
{
q.pop();
cout<<“After pop operation stack is:”<<endl;
q.display();
break;
}

case 3:
{
cout<<“The stack is:”<<endl;
q.display();
break;
}

case 4:
{
cout<<“\n\t******** Thank You for Using this program *************\n”;
break;
}

default:
{
cout<<“Your choice is wrong”<<endl;
}

} // end of switch

} // end of while

cout<<“\n\n”;
} // end of main

Your comment are valueable