Files and I/O
Hard 28 pointsCreate a file "test.txt" with content "Hello C", then read and display its content.
C can read and write files. fopen() opens a file, fwrite() writes, fread() reads, fclose() closes. FILE* represents a file.
Your code
Hint
Use FILE *f = fopen("test.txt", "w"); fwrite("Hello C", 1, 7, f); fclose(f); then read with fopen("test.txt", "r");
Result
Click "Run code" to see the result of your code. Click "Submit" to check if your answer is correct.