/** * read.c * * Andi Peng * Section, Week 4 * * Demonstrates how to write to a file using File I/O */ #include #define STUDENTS 3 int main(void) { int scores[] = {96, 90, 83}; FILE* file = fopen("database", "w"); if (file == NULL) { return 1; } for (int i = 0; i < STUDENTS; i++) { fprintf(file, "%i\n", scores[i]); } fclose(file); }