#include<stdio.h>
struct student
{
char name[20];
int rollno, fees;
};
main()
{
struct student s;
FILE*fp;
fp = fopen("data.dat", "rb");
if(fp == NULL)
{
printf("Error opening file!");
return;
}
fread(&s, sizeof(s), 1, fp);
printf("Name : %s", s.name);
printf("\n Roll No : %d", s.rollno);
printf("\n Fees %d", s.fees);
fclose(fp);
}