// ex_ch9_4.c
#include <stdio.h>

double harmonic_mean(double first, double second);

int main(void)
{
	printf("The harmonic mean of %.2f and %.2f is %.2f.\n",
	       4.0, 7.0, harmonic_mean(4.0, 7.0));
	return 0;
}

double harmonic_mean(double first, double second)
{
	double ifirst = 1/first;
	double isecond = 1/second;
	double average;
	
	average = (ifirst + isecond) / 2;
	return (1 / average);
}

