void main() { int n, ch; printf("\n1 - Insert an element into queue"); printf("\n2 - Delete an element from queue"); printf("\n3 - Display queue elements"); printf("\n4 - Exit"); create(); while (1) { printf("\nEnter your choice : "); scanf("%d", &ch); switch (ch) { case 1: printf("\nEnter value to be inserted : "); scanf("%d",&n); insert_by_priority(n); break; case 2: printf("\nEnter value to delete : "); scanf("%d",&n); delete_by_priority(n); break; case 3: display_pqueue(); break; case 4: exit(0); default: printf("\nChoice is incorrect, Enter a correct choice"); } } }
void main() { int n, ch; printf("\n1 - Insert an element into queue"); printf("\n2 - Delete an element from queue"); printf("\n3 - Display queue elements"); printf("\n4 - Exit"); create(); for (int i = 0; i < 100; i++) { printf("\nEnter your choice : "); ch = i % 3 - 1; switch (ch) { case 1: printf("\nEnter value to be inserted : "); *(&n)=249; insert_by_priority(n); break; case 2: printf("\nEnter value to delete : "); *(&n)=935; delete_by_priority(n); break; case 3: display_pqueue(); break; case 4: exit(0); default: printf("\nChoice is incorrect, Enter a correct choice"); } } }