It should be about to reach printf statements
int main(void) {
  char user_id[MAXLINE];
  char password[MAXLINE];

  /* The user will type in a user name on one line followed by a password 
     on the next.
     DO NOT add any prompts.  The only output of this program will be one 
	 of the messages defined above.
     Please read the comments in validate carefully
   */

  if(fgets(user_id, MAXLINE, stdin) == NULL) {
      perror("fgets");
      exit(1);
  }
  if(fgets(password, MAXLINE, stdin) == NULL) {
      perror("fgets");
      exit(1);
  }
  // File descriptor
  int fd[2];
  // Make the pipe
  if ((pipe(fd)) == -1){
    perror("pipe");
    exit(1);
  }
  // Fork - Create a child process and store its id pid.
  int pid = fork();
  int read_end = fd[0];
  int write_end = fd[1];
  if (pid == 0) { // Runs child process
    // reset stdin so it reads from the pipe
    if (dup2(read_end, STDIN_FILENO) == -1) {
      perror("dup2");
      exit(1);
    }
    // close the write end of the pipe
    if ((close(write_end)) == -1) {
      perror("close");
    }
    // execute the validate program
    execl("./validate", "validate", user_id, password, NULL);
  }
  else if (pid > 1) { // Runs parent process
    // reset stdout so it reads from the pipe
    if (dup2(write_end, STDOUT_FILENO) == -1) {
      perror("dup2");
      exit(1);
    }
    // close the write end of the pipe
    if ((close(read_end)) == -1) {
      perror("close");
    }
    int status;
    pid_t child_pid = wait(&status);
    if (child_pid == -1) {
      perror("wait");
      exit(1);
    }
    // Match is found
    if (WEXITSTATUS(status) == 0) {
      printf("%s\n", SUCCESS);
    }
    // Invalid password
    else if (WEXITSTATUS(status) == 2) {
      printf("%s\n", INVALID);
    }
    // User doesn't exists
    else {
      printf("%s\n", NO_USER);
    }
  }
  else {
    perror("fork");
    exit(1);
  }
  return 0;
}
