Advertisement
shohan11421

part (B) ano

Mar 2nd, 2018
92
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.64 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3. struct node
  4. {
  5.     int x;
  6.     double y;
  7.     struct node *next;
  8. };
  9. struct node *frist = NULL, *temp;
  10. void creat()
  11. {
  12.     struct node *head, *head2, *head3;
  13.     head = (struct node *) malloc(sizeof(struct node));
  14.     head2 = (struct node *) malloc(sizeof(struct node));
  15.     head3 = (struct node *) malloc(sizeof(struct node));
  16.     head -> x = 7;
  17.     head -> y = 2.1;
  18.     head2 -> x = 9;
  19.     head2 -> y = 1.2;
  20.     head3 -> x = 11;
  21.     head3 -> y = 3.2;
  22.     head -> next = head2;
  23.     head2 -> next = head3;
  24.     head3 -> next = NULL;
  25.     frist = head;
  26. }
  27. void print()
  28.  
  29. int main()
  30. {
  31.     creat();
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement