/* read a data from KB and display in file using arguments*/
#include
#include
main(argc,argv)
int argc;
char *argv[];
{
	typedef struct bio
	{
		char name[25];
		int age;
		char sex[7];
	} BIO;
	BIO x;
	FILE *fp;
	clrscr();
	fp=fopen(argv[1],"w");
	if(argc!=2)
	{
		printf("arguments error");
		return;
	}
	if(fp==NULL)
	{
		printf("file opening error");
		return;
	}
	printf("enter the name, age, sex \n");
	scanf("%s%d%s",x.name,&x.age,x.sex);
	fprintf(fp,"%s\t%d\t%s",x.name,x.age,x.sex);
	fclose(fp);
}

/*
How to run this program in Turboc2 software:
step1: compile the program
step2: Go to options in the menu bar select arguments give file name file4
step3: Give data file stroage file name
step4: press enter
step5: run program
How to run this program in Turboc3 software:
step1: compile the program
step2: Go to run in the menu bar select arguments give file name file4
step3: Give data file stroage file name
step4: press enter
step5: run program
*/