Program:
#include<stdio.h>#include<conio.h>void main(){FILE *fsrc, *ftgt;char ch;clrscr();fsrc = fopen(“tiyl.c”, “r”);if (fs = = NULL){puts (“Cannot open source file”);exit();}ftgt = fopen(“tiy2.c”, “w”);if (ft = = NULL){puts (“Cannot open target file”);fclose(fs);exit();} .while(1){ . ch = fgetc(fsrc);if (ch = = EOF)break;elsefputc(ch, ftgt);}fclose(fsrc);fclose(ftgt);}
Your experience on this site will be improved by allowing cookies. Read Cookie Policy