#include <stdio.
h>
#define SIZE 5
int arr[SIZE];
int top=-1;
void push(int n){
if(top==SIZE-1){
printf("Stack is full");
}
else{
top=top+1;
arr[top]=n;
printf(" Pushed a value into the stack: %d\n ", n);
}
void pop(){
if(top==-1){
printf("Stack is empty");
}
else{
int x = arr[top];
top=top-1;
printf("Popped from the Stack: %d \n", x);
}
}
void display(){
for(int i=top;i>=0;i--){
printf("%d ", arr[i]);
}
}
int main()
{
push(10);
push(20);
push(30);
push(40);
push(50);
display();
pop();
pop();
display();
return 0;
}