--:--









Quiz for Reading and writing binary files

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



Logo

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

Logo

Q2: Which function reads data blocks from a binary file?

Logo

Q3: Which function writes data blocks to a binary file?

Logo

Q4: How do you open a binary file for writing (overwrite mode)?

Logo

Q5: How do you open a binary file for appending data?

Logo

Q6: What does fread() return on success?

Logo

Q7: What is a major difference between fread() and fscanf()?

Logo

Q8: Which mode is used with fopen() to read and write binary files?

Logo

Q9: How to move the file pointer in a binary file?

Logo

Q10: What happens if you write to a binary file opened in "rb" mode?

Logo

Q11: Which function closes a binary file?

Logo

Q12: How can you check end of file for a binary file?

Logo

Q13: Can binary files contain text data?

Logo

Q14: Which header file is required for file handling functions?

Logo

Q15: Which function flushes the output buffer to a binary file?

Logo

Q16: What is the return type of fread() and fwrite()?

Logo

Q17: How do you write an integer variable to a binary file?

Logo

Q18: How do you read an integer variable from a binary file?

Logo

Q19: What is the advantage of binary file over text file?

Are you ready to start test? Set your time limit