#include<iostream> using namespace std; class MYBooks { private : int current; int books; int size; int *stack; public : MYBooks(int s, int b) {size=s; stack= new int[size]; books=b; current=-1; } void push(int x) { // -1 +1=0 stack[++current]=x; } int pop() { return stack[current--]; } int top() { return stack[current]; } int isEmpty() { return (current==-1); } int isFull() { //5 4 return (current==size-1); } }; main() { int s, b, id; int s_books=0, h_books=0, o_books=0; cout<<"set the size of stack : "; cin>>s; cout<<endl; cout<<"Number of books you want to add in stack : "; cin>>b; MYBooks book(s,b); //b =5 for(int i=0; i<b; i++) { if(!book.isFull())