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;
else
fputc(ch, ftgt);
}
fclose(fsrc);
fclose(ftgt);
}