Below is the source code for C Program to Find Size of File in File Handling which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
/* C Program to Find Size of File in File Handling */
#include <stdio.h>
int main()
{
FILE *fp;
char ch;
int size = 0;
char * arrr = "C:\\Users\\acer\\Documents\\file4.txt";
fp = fopen(arrr, "r");
if (fp == NULL)
printf("\nFile unable to open ");
else
printf("\nFile opened ");
fseek(fp, 0, 2); /* file pointer at the end of file */
size = ftell(fp); /* take a position of file pointer un size variable */
printf("The size of given file is : %d\n", size);
fclose(fp);
return 0;
}
OUTPUT : :
// The file saved i.e file4.txt is the source code of the program
File opened
The size of given file is : 576
Above is the source code for C Program to Find Size of File in File Handling which is successfully compiled and run on Windows System.The Output of the program is shown above .
Below is the source code for C Program to Find Size of File in File Handling which is successfully compiled and run on Windows System to produce desired output as shown below :
SOURCE CODE : :
OUTPUT : :
Above is the source code for C Program to Find Size of File in File Handling which is successfully compiled and run on Windows System.The Output of the program is shown above .
need an explanation for this answer? contact us directly to get an explanation for this answer