Using feof() to check if the EOF has been reached

Using feof to check when EOF has been reached in the file.