Program gives the program segment by using arrays for the insertion of an element to a queue into the multiqueue.
Program: Program segment for the insertion of any element to the queue
addmq(i,x) /* Add x to queue i */
{
int i,x;
++rear[i];
if ( rear[i] == front[i+1])
printf("Queue is full");
else
{
rear[i] = rear[i]+1;
mqueue[rear[i]] = x;
}
}