/* read a data from KB and display in file using arguments*/
#include
#include
main(argc,argv)
int argc;
char *argv[];
{
	char c;
	FILE *fp1,*fp2;
	clrscr();
	fp1=fopen(argv[1],"r");
	fp2=fopen(argv[2],"w");
	if((fp1==NULL)||(fp2==NULL))
	{
		printf("file opening error");
		return;
	}
	if(argc!=3)
	{
		printf("arguments error");
		return;
	}
	c=getc(fp1);
	while(c!=EOF)
	{
		putc(c,fp2);
		c=getc(fp1);
	}
	printf("succes");
	fclose(fp1);
	fclose(fp2);
}

/*
How to run this program
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
*/