Solution

node *addToEnd(node *first,char name[],int roll_no){ node *new_node=(node *)malloc(sizeof(node)); node *temp=first;

//initialise new node strcpy(new_node->name,name); new_node->roll_number=roll_no; new_node->next=NULL;

//if the list is empty do this. if(first==NULL){ first=new_node; return first; }

//traverse list while(temp->next!=NULL){ temp=temp->next; }

//attach node to end of the list temp->next=new_node; return first; }