tube in c read and write in my program : good evening everyone

I have a problem with my program
I would like my program to display the result like this
child: 2 4 6 8 10
parent: 3 6 9 12 15
child 12 14 16 18 20
parent 18 21 24 27 30
etc 


    #include<stdio.h>
    #include<stdlib.h>
    #include <unistd.h>
    
    main(int argc,char *argv[]){
    int i=0,tube1[2],tube2[2],pid,tube3[2];
    if(pipe(tube1)||pipe(tube2)==-1){
    perror("pipe");
    exit(0);
    }
    pid=fork();
    
    while(i<100){
    
    if(pid==0){
    printf("fils ");
    
    do{
    i=i+2;
    printf("%d ",i);
    }while(i%5!=0);
    
    
    write(tube1[1],&i,sizeof(int));
    
    read(tube2[0],&i,sizeof(int));
    
    
    }
    
    else{
    
    
    
    printf("pere ");
    read(tube1[0],&i,sizeof(int));
    do{
    
    i=i+3;
    printf("%d ",i);
    }while(i%5!=0);
    
    
    write(tube2[1],&i,sizeof(int));
    
    
    
    }
    
    printf("\n");
    
    
    
    
    
    
    
    
    }
    close(tube1[1]);
    close(tube1[0]);
    close(tube2[1]);
    close(tube2[0]);
    }

   

 but i have probleme in my program I do not understand why.
and thank you for your help.
