DS4 (5TH)
DS4 (5TH)
#include <stdio.h>
#define MAX 10
int main()
{
int ele, choice;
while (1) {
//clrscr();
printf("\nQUEUE Elements are : ");
display_Q(QUEUE);
printf("\n\nEnter choice (1:Insert, 2:Display, 3:Remove, 0:Exit):
");
scanf("%d", &choice);
switch (choice) {
case 0:
return 0;
break;
case 1:
printf("Enter an element to insert: ");
scanf("%d", &ele);
insert_in_Q(QUEUE, ele);
break;
case 2:
display_Q(QUEUE);
break;
case 3:
remove_from_Q(QUEUE);
break;
default:
printf("\nInvalid choice\n");
break;
}
}
return 0;
}