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

const float WITHDRAW = 100000;
const float RATE = 1.08;

int main(void)
{
	float account = 1000000.0;
	int year = 0;

	while (account > 0.0)
	{
		account -= WITHDRAW;
		account *= RATE;
		year++;
	}
	printf("It takes %d years to empty the account.", year);
	return 0;
}