while(ptr->next!=nullptr=ptr->nextptr->next new_nodenew_node->next=nullprintf("\ enter the data ")scanf("% "&num)return startstruct node *display(struct node *startstruct node *ptrptr startwhile(ptr !nullprintf("\ % "ptr -data)ptr ptr -nextreturn startstruct node *insert_beg(struct node *startstruct node *new_nodeint numprintf("\ enter the data ")scanf("% "&num)new_node (struct node *)malloc(sizeof(struct node))new_node -data numnew_node -next startstart new_nodereturn startstruct node *insert_end(struct node *startstruct node *ptr*new_nodeint numprintf("\ enter the data ")scanf("% "&num)new_node (struct node *)malloc(sizeof(struct node))new_node -data numnew_node -next nullptr startwhile(ptr -next !nullptr ptr -nextptr -next new_nodereturn startstruct node *insert_before(struct node *startstruct node *new_node*ptr*preptrint numvalprintf("\ enter the data ")scanf("% "&num)printf("\ enter the value before which the data has to be inserted ")scanf("% "&val)new_node (struct node *)malloc(sizeof(struct node))new_node -data numptr startwhile(ptr -data !val