Class 11 Computer Science Chapter 6 File Handling Quiz 8 (25 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. What are the different file modes in Python?
2. Which symbols are used to open and close a list?
3. What method would you use to write multiple lines to a file at once?
4. What is the purpose of the EOF character in a file?
5. The difference between r+ and w+ modes is expressed as?
6. What does the program that performs file position and seek operations do?
7. Choose the CORRECT exceptionString department="JTMK"; Integer no=Integer.parseInt(department);
8. The reason for using pointers in a C program is
9. What is the output of the following code?file = open('data.txt', 'w')file.write('Hello, World!')file.close()
10. What is the purpose of the 'flush' method in file handling?
11. Why is it important to close a file after writing to it?
12. What is the correct declaration?
13. The readlines() method returns
14. What is the last action that must be performed on a file?
15. What is the purpose of the with statement when working with files in Python?
16. What is an absolute path?
17. What is the output of the program in Program 13.4?
18. The regular text file have-extension
19. Which of the following classes define in java.io and used for file handling are abstract?i) Readerii) FileWriteriii) InputStreamiv) FileInputStreamv) PrintStream
20. Close the file with fclose() function.
21. Public class X \{ public static void main(String [] args) \{ try \{ badMethod(); System.out.print("A"); \} catch (RuntimeException ex) /* Line 10 */ \{ System.out.print("B"); \} catch (Exception ex1) \{ System.out.print("C"); \} finally \{ System.out.print("D"); \} System.out.print("E"); \} public static void badMethod() \{ throw new RuntimeException(); \} \}
22. What is the purpose of fprintf()?
23. Which mode opens a file for reading only?
24. Is block parameter in flock() optional
25. Which mode is used to open the binary file for writing?