#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>

int main()
{
	FILE*	pFile;
	double	d;
	char	s[100];

	pFile = fopen("data1.txt", "wt");
	if (pFile == NULL) {
		return 1;
	}
	for (d = 0.1; d <= 10.0; d += 0.1) {
		fprintf(pFile, "%f\n", d * d);
	}
	fclose(pFile);

	pFile = fopen("data1.txt", "rt");
	if (pFile == NULL) {
		return 1;
	}
	while (fgets(s, _countof(s), pFile)) {
		fputs(s, stdout);
	}
	fclose(pFile);
	return 0;
}
