This quiz works best with JavaScript enabled. Home > Class 11 > Class 11 Computer Science Chapter 6 File Handling – Quiz 66 🏠 Homepage 📘 Download PDF Books 📕 Premium PDF Books Class 11 Computer Science Chapter 6 File Handling Quiz 66 (25 MCQs) Quiz Instructions Select an option to see the correct answer instantly. 1. You can use loops to write large amounts of text to a file A) TRUE. B) FALSE. C) All the above. D) None of the above. Show Answer Correct Answer: A) TRUE. 2. ASCII stands for A) American standard code for interchange information. B) American standard for information interchange. C) American standard code for intelligent interchange. D) None of the above. Show Answer Correct Answer: B) American standard for information interchange. 3. Which module is used to work with text files? A) CSV module. B) Pickle module. C) Math module. D) No module is rquired. Show Answer Correct Answer: D) No module is rquired. 4. Which mode is used to add data to an existing file? A) 'w'. B) 'a'. C) 'r'. D) 'x'. Show Answer Correct Answer: B) 'a'. 5. What does "non-volatile data storage" mean? A) Data is lost when the computer is turned off. B) Data can be used even when power to the computer is off. C) Data is stored temporarily in RAM. D) Data is stored only in the CPU. Show Answer Correct Answer: B) Data can be used even when power to the computer is off. 6. In which of the following package, Exception class exist? A) Java.util. B) Java.io. C) Java.lang. D) Java.file. Show Answer Correct Answer: C) Java.lang. 7. Which is correct way to write rows in CSV file? A) Writer.write(row). B) Writer.writerow(row). C) Writer.row(row). D) Writer.addrow(row). Show Answer Correct Answer: B) Writer.writerow(row). 8. Which method is used to read all lines from a file into a list in Python? A) Readlines(). B) Write(). C) Close(). D) Seek(). Show Answer Correct Answer: A) Readlines(). 9. EOF is an integer type defined in stdio. h and has a value ..... A) 1. B) 0. C) -1. D) Null. Show Answer Correct Answer: C) -1. 10. What is the purpose of the function fclose? A) To open a file for reading and writing. B) To create a new file. C) To determine if the file has reached the end. D) To close an open file. Show Answer Correct Answer: D) To close an open file. 11. Select the most appropriate format of tell () A) .tell():. B) .tell(). C) tell():. D) .tell():. Show Answer Correct Answer: B) .tell(). 12. What is the correct way to read a file in Python? A) Use 'with open("filename.txt", "r") as file:content = file.read()'. B) Read('filename.txt'). C) File = open('filename.txt', 'r'). D) Open('filename.txt'). Show Answer Correct Answer: A) Use 'with open("filename.txt", "r") as file:content = file.read()'. 13. Why is it best to open a file with "with" in Python? A) It automatically closes the file. B) Easier to read the code. C) Better for binary files. D) Closers to the pseudocode. Show Answer Correct Answer: A) It automatically closes the file. 14. What is the difference in path styles between Windows and macOS/Linux? A) Windows uses backslashes, macOS/Linux uses forward slashes. B) Both use backslashes. C) Both use forward slashes. D) Windows uses forward slashes, macOS/Linux uses backslashes. Show Answer Correct Answer: A) Windows uses backslashes, macOS/Linux uses forward slashes. 15. What is the process of converting a Python object structure into a byte stream to store in a binary file called? A) Unpickling. B) Serialization (Pickling). C) Appending. D) None of the above. Show Answer Correct Answer: B) Serialization (Pickling). 16. How do you close a file in C using fclose()? A) Fclose(file);. B) Close(file);. C) CloseFile(file);. D) File.close();. Show Answer Correct Answer: A) Fclose(file);. 17. When fwrite is used on already existing file the what will happen A) New contents added to previous file contents. B) Previous file contents deleted and new contents added. C) Error displayed. D) None. Show Answer Correct Answer: B) Previous file contents deleted and new contents added. 18. What is the purpose of fprintf() and fscanf() functions in C? A) Read and write characters. B) Read and write files with additional file pointer argument. C) Read and write integers. D) Read and write files. Show Answer Correct Answer: B) Read and write files with additional file pointer argument. 19. What method do we use as a clean up function, to reallocate the resources used when keeping the file object open? A) .close(). B) .reset(). C) .clear(). D) .release(). Show Answer Correct Answer: A) .close(). 20. What does the 'APPEND' mode do when a file is opened in this mode? A) Reads data from the file. B) Writes data to the file, overwriting any existing content. C) Adds data to the end of the file. D) Deletes the content of the file. Show Answer Correct Answer: C) Adds data to the end of the file. 21. Which function is used to force transfer of data from buffer to file? A) Flush(). B) Save(). C) All the above. D) None of the above. Show Answer Correct Answer: A) Flush(). 22. What does the 'A' parameter signify in the 'open' command when opening a file in Python? A) Add to the beginning of the file. B) Create a new file. C) Append to the end of the file. D) Overwrite the file. Show Answer Correct Answer: C) Append to the end of the file. 23. Function used to write data in binary format A) Write(). B) Output(). C) Load(). D) Dump(). Show Answer Correct Answer: D) Dump(). 24. Which statement is true to open a binary file "Record.txt" for writing and reading? A) File =open("Record.dat", "wr"). B) File =open("Record.dat", "rw"). C) File =open("Record.dat", "ab"). D) File =open("Record.dat", "w+"). Show Answer Correct Answer: D) File =open("Record.dat", "w+"). 25. Which function is used to read all the characters? A) Readall(). B) Readallchr(). C) Read(). D) Readcharacters(). Show Answer Correct Answer: C) Read(). ← PreviousNext →Related QuizzesClass 11 Computer Science Chapter 6 File Handling Quiz 1Class 11 Computer Science Chapter 6 File Handling Quiz 2Class 11 Computer Science Chapter 6 File Handling Quiz 3Class 11 Computer Science Chapter 6 File Handling Quiz 4Class 11 Computer Science Chapter 6 File Handling Quiz 5Class 11 Computer Science Chapter 6 File Handling Quiz 6Class 11 Computer Science Chapter 6 File Handling Quiz 7Class 11 Computer Science Chapter 6 File Handling Quiz 8Class 11 Computer Science Chapter 6 File Handling Quiz 9Class 11 Computer Science Chapter 6 File Handling Quiz 10 🏠 Back to Homepage 📘 Download PDF Books 📕 Premium PDF Books