#include <stdio.h>
int main ()
{
	FILE *f;
	struct rec {
		unsigned long int Eshterak, Masraf;
	} AbRec;
	int i;
	f = fopen("d:\\106_Sample_File.dat", "w+b");
	for (i=1; i <= 15; i++)
	{
		printf ("%d- eshterak ra vared konid : ", i);
		scanf ("%ld", &AbRec.Eshterak);
		printf ("masraf ra vared konid : ");
		scanf ("%ld", &AbRec.Masraf);
		fwrite(&AbRec, sizeof(struct rec), 1, f);
	}
	fclose(f);
	getch();
}

