#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
typedef struct node {
        int data;
        node *next;
        };
void insert (node * root,int data);
int main(){
    node * root =NULL ;
    root = (node *) malloc (sizeof (node));
    root->data = 10;
   
    node * iter =root;
    for(int i = 0;i<3;i++){
            insert(iter,i*200);             
    }
    
    insert(root,400);
    insert(root,700);
    while(iter!=NULL)
    {
                           printf("\n%d",iter->data);
                           iter=iter->next;
    }
    getch();
    return 0;
}
void insert (node * root,int data){
     if(root==NULL){
                    root=(node * ) malloc (sizeof(node));
                    root->data = data;     
     }
     else{
          while(root->next!=NULL){
                                 root=root->next;
          }     
           root->next = (node*)malloc(sizeof(node));
           root->next->data = data;
           root->next->next=NULL;
     }
}












    
    
    
    
    
    
    
    
    
    
    
    

