Advertisement
muftY

2nd ta

Jun 29th, 2020
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.40 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<stdlib.h>
  3.  
  4. typedef struct data
  5. {
  6. int a;
  7. struct data *next;
  8. } data;
  9. data *head=NULL;
  10. //Inser At First
  11. void fst(int x)
  12. {
  13. data *new =(data*)malloc(sizeof(data));
  14. new->a=x;
  15. new->next=NULL;
  16. if(head==NULL)
  17. {
  18. head=new;
  19. return;
  20. }
  21. new->next=head;
  22. head=new;
  23. }
  24.  
  25. int main()
  26. {
  27.  
  28. fst(4);
  29. fst(13);
  30. fst(8);
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement