Advertisement
ahamed210

Append_header_file

Oct 5th, 2020
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.32 KB | None | 0 0
  1. void append(Node *head)
  2. {
  3.     Node *temp;
  4.     Node *new_node = (Node *)malloc(sizeof(Node));
  5.     printf("\nEnter Node item for last : ");
  6.     scanf("%d", &new_node->data);
  7.     new_node->next = NULL;
  8.  
  9.     temp = head;
  10.     while(temp->next != NULL)
  11.     {
  12.         temp = temp->next;
  13.     }
  14.     temp->next = new_node;
  15. }
  16.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement