

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


#include<stdio.h> #include<unistd.h> #include<string.h> Int main() { FILE *in_file; FILE *out_file; char ch; char f[30]; char s[30]; printf(“This program copies the source file to the destination file\n"); printf("Enter source file’s name: \n"); scanf("%s", f); if (in_file =fopen(f,"r")) { printf("Enter destination file’s name: \n"); scanf("%s", s); out_file=fopen(s, "w"); ch=getc(in_file); while(ch!=EOF) { putc(ch,out_file); ch=getc(in_file); } fclose(in_file); fclose(out_file);
printf("\n Destination file has been copied.Here you go \n"); } }