/*
Title: a) Write C program to implement COPY commands of DOS using command line arguments.
 */

#include<stdio.h>
#include<stdlib.h>

int main(int argc,char *argv[])
{
FILE *fp,*fp2;
char x;
if(argc!=3)
{
printf("\nWromg no of arguments");
getchar();
exit(0);
}

fp=fopen(argv[1],"r");
fp2=fopen(argv[2],"w");

if(fp==NULL)
{
printf("\nFile doesnot exist");
getchar();
exit(0);
}

while((x=fgetc(fp))!=EOF)
fputc(x,fp2);

printf("\nFile copied Successfully\n");
getchar();

fclose(fp);
fclose(fp2);
}



//END OF PROGRAM