--:--









Quiz for Reading from and writing to files

Course: C++ Language | Subject: Unit 12 | Topic: File Handling



Logo

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

Logo

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

Logo

Q3: Which function reads a block of data from a file?

Logo

Q4: Which function writes a block of data to a file?

Logo

Q5: Which operator is commonly used for formatted input from files?

Logo

Q6: Which operator is commonly used for formatted output to files?

Logo

Q7: What is the effect of using ios::app mode when writing?

Logo

Q8: Which method checks if the end of file (EOF) is reached?

Logo

Q9: Which function checks if the last input operation failed?

Logo

Q10: Which function checks if the stream is in a bad state (hardware failure)?

Logo

Q11: Which function resets the error state flags on a file stream?

Logo

Q12: What happens if you try to read beyond EOF?

Logo

Q13: How do you open a file for both reading and writing in binary mode?

Logo

Q14: Which stream is used for input from keyboard?

Logo

Q15: Which stream is used for output to the screen?

Logo

Q16: How to check if a file stream was successfully opened?

Logo

Q17: Which method flushes output buffer to the file?

Logo

Q18: What is the use of ios::trunc flag?

Logo

Q19: Which function returns the current read position in a file?

Are you ready to start test? Set your time limit