#include //#include int pop(); void push(int num); int array[10],counter = -1,n=10; int main() { int choice = 0; do { printf("\n\n********** MENU **********\n"); printf("1. PUSH \n2. POP \n3. EXIT \nEnter Your choice:"); scanf("%d",&choice); printf("\n\n"); if(choice == 1) { int num = 0; printf("Enter the number to push :"); scanf("%d",&num); push(num); } if(choice == 2) { int num = pop(); if(num != -1) printf("%d popped from stack \n",num); } }while(choice == 1 || choice == 2); return 0; } void push(int num) { if(counter == n-1) { printf("Stack Overflow \n"); } else { counter++; array[counter] = num; printf("%d pushed into stack\n",num); } } int pop() { if(counter == -1) { printf("Stack empty \n"); return -1; } else { counter--; return array[counter+1]; } }