/* merging two files */
#include
#include
main(argc,argv)
int argc;
char *argv[];
{
	char c;
	FILE *fp1,*fp2,*fp3;
	clrscr();
	fp1=fopen(argv[1],"r");
	fp2=fopen(argv[2],"r");
	fp3=fopen(argv[3],"w");
	if(argc!=4)
	{
		printf("arguments error");
		return;
	}
	c=getc(fp1);
	while(c!=EOF)
	{
		putc(c,fp3);
		c=getc(fp1);
	}
	fclose(fp1);
	c=getc(fp2);
	while(c!=EOF)
	{
		putc(c,fp3);
		c=getc(fp2);
	}
	fclose(fp2);
	fclose(fp3);
	printf("success");
	getch();
}

/*
How to run this program
step1: compile the program
step2: Go to arguments give file name's file4 file5 file6
step3: Give data file stroage file name
step4: press enter
step5: run program
*/
/*
Hint : file4 and file5 are existing files, these two files are overwritten in file6
*/