--:--









Quiz for Reading and writing text files

Course: C Language | Subject: Unit 8 | Topic: File Handling



Logo

Q1: Which function is used to open a text file for reading?

Logo

Q2: Which function reads a line from a text file?

Logo

Q3: Which function writes a string to a text file?

Logo

Q4: What is the difference between fprintf() and fputs()?

Logo

Q5: Which function reads formatted input from a file?

Logo

Q6: Which function writes formatted output to a file?

Logo

Q7: How to close a file after reading or writing?

Logo

Q8: Which function reads a single character from a file?

Logo

Q9: Which function writes a single character to a file?

Logo

Q10: How to append data to an existing text file?

Logo

Q11: What does fgets() return when it reaches end of file?

Logo

Q12: Which function can be used to read a block of data?

Logo

Q13: Which function writes a block of data?

Logo

Q14: Can fscanf() be used to read integers from a text file?

Logo

Q15: What happens if you write to a file opened in "r" mode?

Logo

Q16: How to move file pointer to beginning?

Logo

Q17: Which function returns EOF on error or end of file?

Logo

Q18: Is text file reading line-oriented or binary?

Logo

Q19: Which function is safer for reading strings from files to avoid buffer overflow?

Are you ready to start test? Set your time limit