End Google Ads 201810 - BS.net 01 --> Dear All,

i had write a code in C, but when execute, it an error.

May i know how to combine a correct structure ? kindly advise, thank you

Output results

**Enter integers: 23 12 34 56 78 12

Traversing the list : 23->12->34->56>78->12

Minimum value : 12

Reversing the list: 12->78->56->34->12->23**






#include #include struct node { int data; struct node *next; }*head; void insert_data(int value){ struct node *var,*temp; temp=head; var=(struct node *)malloc(sizeof(struct node)); var->data=value; if(head==NULL) { head=var; head->next=NULL; } else { while(temp->next!=NULL) { temp=temp->next; } var->next=NULL; temp->next=var; }} void reverse_list(){ struct node *temp,*temp1,*var; temp=head; var=NULL; while(temp!=NULL) { temp1=var; var=temp; temp=temp->next; var->next=temp1; } head=var;} void display(){ struct node *var; var=head; printf("\nlist of elments are \n"); while(var!=NULL) { printf(" %d ->",var->data); var=var->next; }} int main(){ int i,value; char ch='y'; head=NULL; printf("\nEnter Integers: "); scanf("%d",&value); insert_data(value); display(); }getch(); }