fopen with "r", then fscanf or fgets into a buffer, then print what you read.
Read mode opens an existing file and copies bytes into your variables. Here the file already holds Hello. fscanf pulls that word into a buffer, then printf shows it on the screen.
open
Hello
Hello
done
Each step highlights the matching C line. Program output appears only when a line that prints actually runs.
Five questions. Pick one answer each, then Check answers. The correct choice turns green.
1. This run prints:
fscanf then printf.
2. "r" fails when:
NULL.
3. fgets vs fscanf %s:
Line vs word.
4. After fscanf, you should still:
Close.
5. Binary read uses:
Another kind.