Question:Write a c program to find out the size and drive where file has stored of any given file? 

Answer 
#include "time.h"
#include "sys\stat.h"
#include "stdio.h"
int main(){
    struct stat status;
    FILE *fp;
    fp=fopen("test.txt","r");
    fstat(fileno(fp),&status);
    printf("Size of file : %d",status.st_size);
    printf("Drive name   : %c",65+status.st_dev);
    return 0;
}
 

+ ExplanationNot Moderated
+ Report
Total Preview: 574
Write a c program to find out the size and drive where file has stored of any given file?
Copyright © 2025. Powered by Intellect Software Ltd