#include "chapter2.cpp"

typedef double runtype;

void main()
{
	ofstream outfile("chap2.txt");
	runtype y, x;
	int n;

	x = 16.0;
	outfile << setw(5) << "n" << setw(15) << "x" << setw(15) << "y";
	outfile << setw(15) << "x-sin(x)" << endl;
	for (n = 1; n <= 52; n++)
	{
		x *= 0.25;
		y = f(x);
		outfile << setw(5) << n << setw(15) << x << setw(15) << y;
		outfile << setw(15) << x-sin(x) << endl;
	}
}