Make your own free website on

programming with c language (7)

 program to write into a file some variables and constants
 then reading from the file to display to screen

float price[]={25.20,100.00,8.95}, cost;
char *description[]={"Pencils","Pens","Erasers"};
char desc[10];

 int i;
 FILE *f, *fopen();
 fprintf(f,"Nicholas \n");
  fprintf(f, "%9s %6.2f\n", description[i],price[i]);

 while(fscanf(f,"%s %f", desc,&cost) != EOF)
   printf("%9s %6.2f\n", \

Click here to go back to 'C' programming
If you have comments or suggestions, email me at

This page created with Netscape Navigator Gold (17/9/1999)