C Program to read data from file using fgetc() function

3 years ago
C Programming

C program to read data from file using fgetc() function

#include<stdio.h>

void main()

{

    FILE *fp = NULL;

    fp = fopen("file.txt", "r");

    char ch = fgetc(fp);

    printf("The character i read from file is : %c", ch);

    fclose(fp);

}
0
Rajiv Shah
Jul 21, 2022
More related questions

Questions Bank

View all Questions