#include #include typedef struct node{ int val; struct node* next; } Node; void addit(Node *header, int w) { Node *ptr,*temp; ptr=header; while(ptr->next != NULL) {if (ptr->next->val > w) break; if (ptr->next->val == w) return; ptr= ptr->next; } temp= (Node *) calloc(1,sizeof(Node)); temp->next=ptr->next; temp->val=w; ptr->next=temp; // header=NULL; Adding this will not change the outcome } void printit(Node *header) { Node *ptr; ptr = header; printf("New Printing\n"); while (ptr->next != NULL) { printf("%d\n",ptr->next->val); ptr= ptr->next; } printf("\n"); } int main(void) { int n,i,w; // Creates a sorted list of positive numbers. // Repeated elements are eliminated. Node *header; header = (Node*) calloc(1,sizeof(Node)); header->next=NULL; header->val=-1; scanf("%d",&n); for (i=0; i