C language prints the contents of the file

C language prints the contents of the file
// example: C language reads files and prints content 

/*
Example: how to print a file in C language
*/
#include <stdio.h>
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <stdbool.h>
#include <errno.h>
#include <unistd.h>

int main() {
    FILE* fptr = fopen("test.txt","r");
    char c = fgetc(fptr);
    while (c != EOF)
    {
        printf ("%c", c);
        c = fgetc(fptr);
    }
    fclose(fptr);
    return 0;
}
Sou‮l.www:ecr‬autturi.com
Created Time:2017-08-29 10:13:16  Author:lautturi