char stack[40]; //Stack is being definedint top=-1; //Setting the initial value of stack top element to '-1'char pop() //Declaring a function to pop from the stack{char a;a=stack[top];top--;return a; //Function pop() will return the popped value}

void push(char item) //Function for pushing the value in stack{top++;stack[top]=item;}