#include "queue.h" void instructions() { printf("To use the queue\n"); printf("1: enqueue a value\n"); printf("2: dequeue a value\n"); printf("3: prints content of queue\n"); printf("4: exits\n"); } int main() { Node *head = NULL; Node *tail = NULL; int choice; int value; instructions(); printf("> "); scanf("%d",&choice); while ( choice != 4 ) { switch ( choice ) { case 1: printf("Enter int: "); scanf("%d",&value); enqueue(&head,&tail,value); break; case 2: if ( is_empty(head) ) { printf("Empty\n"); } else { value = dequeue(&head,&tail); printf("Dequeued: %d\n",value); } break; case 3: print(head); break; default: instructions(); break; } printf("> "); scanf("%d",&choice); } return 0; }