/* read a data from KB until name='$' and store in file */
#include
#include
main()
{
	typedef struct bio
	{
		char name[25];
		int age;
		char sex[7];
		char design[20];
		float salary;


	} BIO;
	BIO x;
	FILE *fp;
	clrscr();
	fp=fopen("file2","w");
	if(fp==NULL)
	{
		printf("file opening error");
		return;
	}
	printf("enter the name age sex designation salary until name='$' \n");
	for(scanf("%s",x.name);x.name[0]!='$';scanf("%s",x.name))
	{
		scanf("%d%s%s%f",&x.age,x.sex,x.design,&x.salary);
		fprintf(fp,"%s\t%d\t%s\t%s\t%f",x.name,x.age,x.sex,x.design,x.salary);
	}
	fclose(fp);
}
/* the file2 is stored within the turboc directory */