question archive Q4) Figure below shows an incomplete C program that input 4 integers 3 points from user in a linked list
Subject:PhysicsPrice: Bought3
Q4) Figure below shows an incomplete C program that input 4 integers 3 points from user in a linked list. Based on the comments given, write the missing C statements. * mainc 1 #include <stdio.h> IN #include <stdlib.h> struct Node { 5 int key; 6 struct Node "next; 7 8 9 int main () 10 { 11 int j=0, val, sum=0; 12 struct Node "head; 13 struct Node curr; 14 15 head (struct Node ")malloc(sizeof (struct Node)); 16 head->key-0; 17 head->next=NULL; 18 curr-head; 19 20 //Q4. Prompt user for the Last 4 digits of his/her id number 21 Using a Loop, repeat the followings for 4 times: 22 Input a digit from user and store it in variable val 23 Create a new node and assign the starting address off the allocated memory to curr->next 24 Set the key member of the new node to val 25 Set the next member of the new node to NULL 26 Set pointer curr to point to the new node 27 28 return 0; 29