1 2 3

Prints data values of all elements in the linked list

void print (Nodeptrlist)
{
for ( ; list != NULL; list = list->next)
printf ("%d ", list->data);
printf ("\n");
}

Use insert-sort function to place items in descending order and print
function to display them

void main (void) {
Nodeptrlist = NULL;
int item;

while (scanf ("%d", &item) != EOF)
if (insertsort (&list, item) == NULL)
break; print(list);

}

3