How do I begin to attempt to use linked lists to solve this? here…

Question Answered step-by-step How do I begin to attempt to use linked lists to solve this? here… Image transcription textYour task is to add code to this function in prac_q4.c: // product should return the sum of the elements in List1multiplied by // the corresponding element in List2 // if one List is Longer than the other, the extra Listelements are ignored int product (struct node *head1, struct node *head2) { // PUT YOUR CODE … Show more… Show moreHow do I begin to attempt to use linked lists to solve this?here is the starter code below to help, I need help creating the function int product to solve this problem:  #include #include #include #include struct node {   struct node *next;   int          data;};int product(struct node *head1, struct node *head2);struct node *strings_to_list(int len, char *strings[]);// DO NOT CHANGE THIS MAIN FUNCTIONint main(int argc, char *argv[]) {   // create two linked lists from command line arguments   int dash_arg = argc – 1;   while (dash_arg > 0 && strcmp(argv[dash_arg], “-“) != 0) {       dash_arg = dash_arg – 1;   }   struct node *head1 = strings_to_list(dash_arg – 1, &argv[1]);   struct node *head2 = strings_to_list(argc – dash_arg – 1, &argv[dash_arg + 1]);   int result = product(head1, head2);   printf(“%dn”, result);   return 0;}// product should return the sum of the elements in list1 multiplied by // the corresponding element in list2// if one list is longer than the other, the extra list elements are ignored int product(struct node *head1, struct node *head2) {  //add code here}// DO NOT CHANGE THIS FUNCTION// create linked list from array of stringsstruct node *strings_to_list(int len, char *strings[]) {   struct node *head = NULL;   for (int i = len – 1; i >= 0; i = i – 1) {       struct node *n = malloc(sizeof (struct node));       assert(n != NULL);       n->next = head;       n->data = atoi(strings[i]);       head = n;   }   return head;}  Engineering & Technology Computer Science COMP 1511 Share QuestionEmailCopy link Comments (0)