- Define a node comprising two members—data and next. The data member is for storing integer values and the next member is a pointer to link the nodes as follows:
struct node{ int data; struct node *next;};
- Specify the number of elements in the linked list. The value entered will be assigned to the n variable as follows:
printf("How many elements are there in the linked list ?");scanf("%d",&n);
- Execute a for loop for n number of times. Within the for loop, a node is created by the name newNode. When asked, enter an integer value to be assigned to the data member of newNode as follows:
newNode=(struct node *)malloc(sizeof(struct node));scanf("%d",&newNode->data);
- Two pointers, startList and temp1, are set to point at the ...