Program 361: Display File Size
Both C Program and file should be in single folder //Coming Soon
Output:
#include <stdio.h> main(void) { FILE *fp; char filename[80]; long length; printf("Enter File name\n"); gets(filename); fp=fopen(filename,"rb"); if(fp==NULL) { printf("File Not Found!\n"); } else { fseek(fp,0L,SEEK_END); length=ftell(fp); printf("Size of the file is %ldB in bytes\n",length); fclose(fp); } }Explanation:
Both C Program and file should be in single folder //Coming Soon
Output: