Following is the function that find the length of the queue.
void length() { struct node *ptr; int len=0; ptr=front; while(ptr!=NULL) { len++; ptr=ptr->next; } printf("Length of queue is %d",len); }