-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathFILE_LINE.C
55 lines (44 loc) · 864 Bytes
/
FILE_LINE.C
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#include<stdio.h>
void main()
{
FILE *fpr1,*fpr2,*fpw;
char ch;
int i=1;
char file1[20],file2[20],file3[20];
printf("\n enter file name destination file :: ");
scanf("%s",file3);
printf("\n enter sorce file 1 path :: ");
scanf("%s",file1);
printf("\n enter sorce file 2 path :: ");
scanf("%s",file2);
fpw = fopen(file3,"w");
fpr1 = fopen(file1,"r");
fpr2 = fopen(file2,"r");
printf("%d..",i);
while(!feof(fpr1))
{
ch = fgetc(fpr1);
fputc(ch,fpw);
printf("%c",ch);
if(ch == '\n')
{
i++;
printf("\n%d..",i);
}
}
printf("\n");
printf("\n%d..",++i);
while(!feof(fpr2))
{
ch = fgetc(fpr2);
fputc(ch,fpw);
printf("%c",ch);
if(ch == '\n')
{
i++;
printf("\n%d..",i);
}
}
fcloseall();
scanf("%d");
}