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

const float STARTING_MONEY = 100.0;
const float SIMPLE = 1.10;
const float COMPOUND = 1.05;

int main(void)
{
	int year = 0;
	float simple_money = STARTING_MONEY;
	float compound_money = simple_money;

	do
	{
		printf("Year %2d: Simple $%.2f Compound $%.2f\n", 
			year, simple_money, compound_money);
		simple_money += (STARTING_MONEY * SIMPLE - STARTING_MONEY);
		compound_money *= COMPOUND;
		year++;
	} while (compound_money < simple_money);
	printf("Compound investmant exceeds simple investment after %d years.\n",
		year);

	return 0;
}