Simple linked list solution


Original Work ?
Category: You will Instantly receive a download link for .ZIP solution file upon Payment


5/5 - (1 vote)

Write a program in C that does the following:
a) Builds a simple linked list consisting of 10 nodes each of which contains a random integer
between 50 and 100 inclusive. The list is to be built in main() and must be a local variable
in main().
b) Includes a user-defined function named printout(arg) that takes in the head pointer of
the already-built linked list as an argument and prints out the contents of the linked list to
the screen, starting from the head of the list to the tail. See the output below.
Node #0 contains 53
Node #1 contains 78
Node #2 contains 95
Node #20 contains 100
c) Includes a user-defined function called sum() that adds up the contents of the data
members of each node in the list, and prints out the total as follows:
The sum total of all nodes in this list is