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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What is the first step in writing to a file?
2. What is the purpose of the 'fgetc()' function in C?
3. Explain the process of writing data to a binary file.
4. Which statement is TRUE about the 'EOF' function?
5. A programmer want to read, write or append file to do some specific operation .while doing this, a programmer must ..... file.
6. Which of the following is an example of pseudocode for reading a line from a file?
7. Which Python module is commonly used for handling CSV files?
8. Matilda and Alexander are working on a coding project. Can you help them figure out the correct way to close a file object named file?
9. Apa nama method yang membaca semua baris dalam file dan menyimpannya dalam list?
10. What is the purpose of using Fileinputstream in Java?
11. What is the use of seek() method in files?
12. What does the 'close()' method do for a file object?
13. "w" mode deletes everything first, and then writes the content.
14. What could happen if you forget to close a file after writing to it?
15. Select a function which is used as a formatted output file function
16. How do you check if a file exists in Python?
17. Which read method(s) will read the entire contents of the file (by default)?
18. What does the suffix attribute of a Path object return?
19. What is the difference between 'read()' and 'readlines()'?
20. Name the module that has to be imported to write a csv file.
21. In which mode does a file get created if it doesn't already exist?
22. Why is data stored in a file instead of only using variables in a program?
23. A(n) ..... access file is also known as a direct access file.
24. Which exception is raised when trying to open a file that does not exist?
25. What is the purpose of the 'newline' parameter in the open() function?
26. The w+ mode to facilitate .....
27. Ftell() returns .....
28. In which mode do we open a file for reading and writing binary data?
29. Which of the following function is used with the csv module in Python to read the contents of a csv file into an object
30. What is the function "w" in file handling
31. How do you allocate memory for an integer variable in C using malloc()?
32. What is the use of the 'seek' method in file handling?
33. Which of the following is a built-in module in Python?
34. What will happen if you try to read from a closed file?
35. Which one of the following access mode does not allow writing
36. Which function is used to move the file position to a desired location within the file?
37. When reading from text files, which of the following can you use to check ifthe last line of a testfile called (FileA.txt) has been reached?
38. What happens if a recursive function does not have a base case?
39. How do you read a character from a file in C using fgetc()?
40. Which method could be used to strip specific characters from the end of a string?
41. What is the function used to create a new directory in Python?
42. What will happen if you open a file in 'w' mode and write to it?
43. In which file the data is stored in ASCII and Unicode Characters?
44. What is a stream associated with in C programming?
45. What is the function of feof in file handling?
46. What does the 'close()' method do?
47. Files are used by programs to store data needed for later use.
48. The syntax of seek() is:file ..... object.seek(offset[.reference ..... point])what is the default value of reference ..... point?
49. What does a cursor do in the context of file handling?
50. What is the function of ftell()?
51. Which operator is used to join Path objects in Python?
52. Code executed based on a condition being true
53. To read the next line of the file from the object infi, we use
54. The data files can be stored in ..... ways.
55. Joining elements together to make a string is called what?
56. In fob=open("fruits.txt", 'r'), fob refers to .....
57. If a file is opened using the with statement, what is the main advantage?
58. Choose the correct output from the options given below:#include struct st { int x; struct st next;}; int main(){ struct st temp; temp.x = 10; temp.next = temp; printf("%d", temp.next.x); return 0;}
59. What is file handling in C++ programming?
60. Structure variable memory is allocated: