Professional Documents
Culture Documents
else return true; } bool check_full(){ if(chk==size) return false; else return true; } void push(int n){ if(check_full()){ chk=chk+1; stack[chk]=n; } else { cout<<"Stack is full"<<endl; } } void pop(){ int value; if(check_empty()){ value=stack[chk]; chk=chk-1; cout<<value<<endl; } else{ cout<<"Stack is empty"<<endl; } } void main(){ int n,m,c=0; cout<<"Press 1 for push "<<endl; cout<<"Press 2 for pop "<<endl; cout<<"Press 3 for exit "<<endl; while(n!=3){ cout<<"###############Enter option in numbers##########"<<endl; cin>>n; if(n==1){ cout<<"Enter Value:";