#include <sys/wait.h>
#include <sys/types.h>
#include <unistd.h>
#include <errno.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(){
    srand(time(NULL));
    pid_t p1,p2,p3,wpid;
    int status;

    p1=fork;
    switch (p1)
    {
    case -1:
        printf("ERROR %d", errno);
        break;
    
    case 0:
        printf("P1: Soy el hijo 1 mi pid es %d, y el de mi padre %d \n", getpid(), getppid());
        int n= rand()%20+1;
        exit(n);
        break;
    }
}