Not understanding the difference

what is the difference between
while(temp->next!=NULL); and while(temp!=NULL);

as both will iterate till the last node of the link list

@shivamgoel150 the first one will stop when temp is at the last node, which means when the loop is over temp will be pointing at the last node of the list. Whereas, at the end of the seond loop, temp will be pointing ar NULL.