C Programming File Handling | Read, Display & Search in *files

Write a Modular C Programming code for Reading, Displaying, and operations on files*

*The file should be saved in (student.txt) this Format in the location of this c file.
Rno   Name    CGPA
1     ABC      7
2     PQR      9
3     MNO      8
4     DEF      10

It will Display all student record who have got CGPA >= 8.5

Refer To Notes:  Notes: File Handling in C programming | Operations in Files


struct student
    int rno;
    char name[20];
    double cgpa;
void display(FILE *);
int main()
    FILE *fp1;
    fp1 = fopen("student.txt","r");
    return 0;
void display(FILE *fp)
    struct student s;


2 PQR 9 
4 DEF 10

Process returned 0 (0x0)   execution time : 369.409 s
Press any key to continue.


Please find some more codes of 1D Arrays, 2D Arrays, Strings, Pointers, Data Structures, Files, Linked lists, and MISC on the below page:

Top 100+ C Programming codes – KLE Technological University



Leave a Comment

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

Welcome to FactsPrime

Sorry, We have detected that you have activated Ad-Blocker. Please Consider supporting us by disabling your Ad Blocker, It helps us in maintaining this website. To View the content, Please disable adblocker and refresh the page.

Thank You !!!