include<stdio.h>
main()
int q[5],lim,f=-1,-1,ele,i,ch;
clrscr();
printf("\n enter queue size:");
scanf("%d",&dim); while(1)
printf("\n menu.. \n");
printf("\n 1.insertion t 2.deletion it 3.display \t 4.exit \n"); printf("n enter your choice:");
scanf("%d",&ch); switch(ch)
case 1:/*insertion operation*/
if(r=lim-1)
printf("\n queue is full");
else
if(f==-1)
printf("\n enter first element:"); scanf("%d",&ele);
f=0; r=0;
else
printf("\n enter any element:"); scanf("%d",&ele);
break;
case 2: deletion operation"/ if(f==-1)
printf("\n queue is empty:");
else printf("\n %d is deleted",q[f++]);
break:
case 3: display operation if(fam-1)
*/
printf("in queue is empty");
else
printf("in linear queue elements are:\n");
printf("\n front-->"); for(i=f;i<=r;i++)
printf("\t%d",q[i]);
printf("--> rear");
break; case 4:exit(0);
break;
case 5:printf("in invalid option");
break;