..............
->  int f = fork();
		if (f == -1)
			// error
		if (f == 0){
			// child
			exit(0);
		}else{ 
			//parent
			wait(0);
		}

Exercise 1

int main(int argc, char *argv[]) {
	int f = fork();
	if (0 > f) {
		perror("Error on creating child process");
		exit(1);
	} else if (0 == f) {
		// child
		exit(0);
	} else {
		// parent
		wait(0);
	}

	int f = fork();
	if (0 > f) {
		perror("Error on creating child process");
		exit(1);
	} else if (0 == f) {
		// child
		int f2 = fork();
		exit(0);
	} else {
		// parent
		wait(0);
	}

	return 0;
}