C Program To Read file Line by Line

How to write a C Program To Read file Line by Line ?


Solution:

#include<stdio.h>

int main(void){
        FILE *file;
        file=fopen("test.log","r");

        char line[128];
        while(fgets(line,sizeof(line),file))
                fputs(line,stdout);
        fclose(file);
}

C Program Quadratic equation


Learn More :