#include <stdio.h>
#include <string.h>

#include <sys/types.h>
#include <unistd.h>
#include <sys/wait.h>

char msg[100];

int main()
{	
	pid_t flag;
	int counter;

	strcpy(msg, "hi");
	
	flag = fork();

	if(flag) {
		for(counter = 1; counter <= 100; counter++) { 
			printf("Parent: %s\n", msg);
		}
		wait(0);
		return(0);
	} else {
		for(counter = 1; counter <= 100; counter++) { 
			printf("Child: %s\n", msg);
			strcpy(msg, "ho");
		}
		return(0);
	}

}
