This C program will read an input file and copy the content to another file with Line numbers..!!
#include<stdio.h>
main()
{
FILE *f1,*f2;
int t=0;
char line[20];
f1=fopen("in.c","r");
f2=fopen("out.c","w");
while(!feof(f1)){
fgets(line,20,f1);
t++;
fprintf(f2,"%d %s",t,line);
}
getch();
}
Posted in:
C PROGRAMS
Email This
BlogThis!
Share to Facebook
0 comments :
Post a Comment