Doubt in video while printing the circular linked list

Here sir has inserted 5 data points in the circular linked list …i.e, 50,40,30,20,10 but when he prints the circular linked list.It is showing only 50,40,30,20

hi @ashishnnnnn the problem is with the print function

while (temp->next != head){
    cout << temp->data << " ";
    temp = temp->next;
} 

this will make temp stop when it reaches the last node
so we need to print the last node separately

//after the while loop ends
cout << temp->data;