Question

9. If the program was able to successfully open the file for writing, then it must write to it the

contents of the list, (i.e., in the sorted order). The file contents will look exactly as is the case with the LIST

command.

The program will then free all the memory allocated to the linked list and terminate with code 0.