#include<stdio.h> void main(){ FILE *fp; fp = fopen("test","a"); fprintf(fp,"%d %s %d\n",1,"1 a 1",2); fclose(fp) ; fp = fopen("test","r"); char rollno[10],name[10],marks[10]; fscanf(fp,"%d %s %d\n",&rollno,&name,&marks); printf(" %d %s %d\n",rollno,name,marks); fclose(fp); }