Professional Documents
Culture Documents
Practical No.:10(a)
Methodology followed:
#include <stdio.h>
return res;
}
// Driver code
int main()
{
char file_name[] = { "a.txt" };
long int res = findSize(file_name);
if (res != -1)
printf("Size of the file is %ld bytes \n", res);
return 0;
}
Theoretical Principles used: Here we extensively used the concept of file
management with a little use of if..else.
Input/Output:
Methodology followed:
#include <stdio.h>
#include <stdlib.h>
int main()
{
// Open two files to be merged
FILE *fp1 = fopen("file1.txt", "r");
FILE *fp2 = fopen("file2.txt", "r");
fclose(fp1);
fclose(fp2);
fclose(fp3);
return 0;
}
Input/Output:
Methodology followed:
#include <stdio.h>
#include <stdlib.h> // For exit()
int main()
{
FILE *fptr1, *fptr2;
char filename[100], c;
fclose(fptr1);
fclose(fptr2);
return 0;
}
Input/Output:
Conclusion:
In this whole practical I learn about how calculate length of file and how to To
concatenate two files.