Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. struct node
  5. {
  6. int info;
  7. struct node *next;
  8. };
  9. typedef struct node node;
  10.  
  11. node *inserthead(node *head, int a){
  12. node *ptr;
  13. ptr = (node*)malloc(sizeof(node));
  14. ptr->info = a;
  15. ptr->next = head;
  16. return(ptr);
  17. }
  18.  
  19. node *deletemultiples(node *head, int k){
  20. }
  21.  
  22. void printlist (node *head){
  23. while (head != NULL){
  24. printf("%d, ", head->info);
  25. head = head->next;
  26. }
  27. printf("\n");
  28. }
  29.  
  30. int main(){
  31. int i;
  32.  
  33. // This for loop creates the initial list of all integers 2-1000.
  34. for (i = 1000; i < 1; i++){
  35. }
  36.  
  37. // This deletes all multiples of all numbers between 1-32 from the list.
  38.  
  39. // This prints the list.
  40. printlist(head);
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement