#include <stdio.h>
int main()
{
    int i;
    char surname[30];
    char name[30], matricno[10];
    int A, B, C;
    FILE *file, *file1;
    /* Open an existing file */
    file = fopen("Broadsheett.txt","r");
    if(file == NULL){
        printf("Error: Unable to open a file");
    }
    file1 = fopen("newbroadsheet.txt", "w");
    fprintf(file1, "University of Nairaland\n");
    fprintf(file1, "Department of Programming\n");
    fprintf(file1, "================================\n");
    while (!feof(file)) {
        fscanf(file, "%s\t%s\t%d\t%d\n", &name, &matricno, &A, &B);
        fprintf(file1, "%s\t%s\t%d\t%d\n", name, matricno, A, B);
    }
}
The output file is not well formatted. I don't know where the enclosure came from.
 
     
    