Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <stdio.h>
int main() {
FILE *fp;
char line[100];
fp = fopen("output.txt", "r");
if (fp == NULL) {
printf("Error opening file\n");
return 1;
}
fgets(line, sizeof(line), fp);
printf("Read using fgets: %s", line);
fclose(fp);
return 0;
}Coding works best on desktop or with an external keyboard.