Class 11 Computer Science Chapter 6 File Handling Quiz 10 (60 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. In fopen("mystory.txt", "r"), what does the mode "r" mean?
2. Assume that size of an integer is 32 bit. What is the output of following program?#includestruct st{ static int x; int y;};int main(){ printf("%zu, sizeof(struct st)); return 0; }
3. Which function is best to check if a file exists before opening?
4. We can manage (create/read/update)CSV files using
5. Which function is used to read the contents of a file in Python?
6. What will happen if file.read() is called twice?
7. This statement terminates the loop containing it.
8. Mention the data type of variable check in the following statements? a. check=f.read()b. check=f.readline()c. check=f.readlines()
9. What is the purpose of the 'os.path.exists()' function?
10. Which of the following exception is thrown in case when the file specified for writing is not found?
11. What is the result of this code snippet?with open('data.txt', 'r') as f:content = f.read() print(content)
12. Apa yang dimaksud dengan file biner?
13. To read the next line of the file from a file object infi, we use:
14. What is the significance of file closing in C++?
15. ..... file is efficient and best way to store information.
16. How can you open a file in read and write mode simultaneously in Python?
17. In a binary file 'a+' mode is equal to .....
18. What is the purpose of the .strip() method in Python file handling?
19. Appending data to a file places it at the start of the file.
20. Which function is equivalent to getchar() but requires a file pointer as an argument?
21. Fread() returns:
22. A file is opened in "r+" mode. Which is TRUE?
23. Which function is used to change the file position in Python?
24. What does the 'R' parameter signify when opening a file in Python?
25. These files are organized by time.
26. How many types of files are there?
27. To read the next line of the file from a file object fobj, we use:
28. In f=open( "data.txt" , "r" ), r refers to .....
29. The ..... character is used to separate the values in CSV files.
30. Which class is used for output file stream operations in C++?
31. What does the "w" mode do when opening a file in Python?
32. Which Tkinter widget is used to create a graphical slider for selecting a value?
33. What does the 'readline()' function do when reading a file in Python?
34. What is the result of using 'a' mode when opening a file?
35. Which of the following mode will refer to binary data?
36. How do you handle errors when working with files in Python?
37. What is the purpose of the 'write' function in Python file handling?
38. Fstream library provides C++ programmers with ..... classes for working with files
39. A bunch of bytes stored on some storage device is .....
40. What does the 'break' statement do in C++?
41. Which function is used to change the file pointer position?
42. Which of the following commands can be used to read the entire contents of a file as a string using the file object ?
43. How can you handle file exceptions in Python?
44. Which method returns the name of the file?
45. In Python the default mode while opening the file is .....
46. What is the correct order of attributes for a character in the text file as used in the program?
47. Explain the first-fit and best-fit memory allocation techniques.
48. Which method is used to write row by row into a csv file along with writer object?
49. What is the output of the following code?def greet(name):print("Hello, '' + name)result = greet("John")
50. Class at the top of exception class hierarchy?
51. What is a recursive function?
52. What is the difference between 'r' and 'w' file modes?
53. What does the 'os.path.relpath()' function do?
54. What letter is added to the modes "r" and "w" to allow them to access non-textual (or binary) information?
55. Java.lang.NullPointerException is a
56. Which mode should be used to add data to an existing file without deleting its contents?
57. Identify the correct syntax for opening a file
58. ..... error also known as bug or semantic error
59. FileNotFoundException
60. Select a function which is used to read a single character from a file at a time