Read the content of File

read the contents of sample.txt file and display it.

Program or Solution


Program Explanation

fopen() to open the specified file.

"sample.txt" is file name.

"r" denotes open it in read mode. fgetc() reads character by character from file.

Note: sample.txt should exsist in the same folder where your program is located.

Tech Events