#include <pthread.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

void* print1() {
    int i = 0;
    while (i < 5) {
      printf("Hi, how do you do?\n");
      sleep(0.1);
      i++;
    }
    pthread_exit(0);
}

void* print2() {
  int i = 0;
  while (i < 5) {
    printf("Hello, how are you?\n");
    sleep(0.1);
    i++;
    }
    pthread_exit(0);
}

int main() {
  pthread_t tr1, tr2;
  pthread_create(&tr1, NULL, print1, NULL);
  pthread_create(&tr2, NULL, print2, NULL);
  int i = 0;
  while (i < 5) {
    printf("Let me introduce you.\n");
    sleep(0.1);
    i++;
  }
  pthread_join(tr1, NULL);
  pthread_join(tr2, NULL);
  exit(0);
}
