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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which of the following function returns a list datatype
2. Which mode should you use to open a file for writing in text mode, creating it if it doesn't exist?
3. If you open a file in 'r' mode and it does not exist, what happens?
4. Mode apa yang digunakan untuk menulis ke file baru dalam fopen?
5. How can you create a new file if it does not exist when opening it?
6. What happens if fopen("abc.txt", "r") fails?
7. What does the 'r' mode in the 'open()' function signify?
8. What happens if you try to close a file that is already closed?
9. In CSV file all data's are stored in ..... format
10. What is the purpose of the sys.path list?
11. The csv file is a ..... file.
12. What happens if the CSV file being read by Reyansh contains inconsistent row lengths?
13. ..... Open the file for writing. The file is created if it does not exist.
14. What will be the ouput-f=open('abc.txt', 'w')x=f.read()f.close()print(x)
15. What is the role of the function fputs in file handling?
16. Which types of file requires translation?
17. File handling isn't needed as programs can save data to be accessed again later without them
18. A stream is a sequence of data and stream is composed of .....
19. How can standard output be redirected to a file in Python?
20. What will be the output of the following code?import mathprint(math.sqrt(16))
21. Which mode should be used with the 'open()' function to append data to an existing file?
22. ..... and ..... are the two objects associated with the csv module to read and write onto a CSV file.
23. Whether following code create file xyz.txt or not?import java.io.*; class demoFile { public static void main(String args[]) { try { File f = new File("C:/java/xyz.txt"); } catch(Exception e) { } catch(IOException e) { } } }
24. Which function is used to write multiple lines in text file?
25. What is a binary file and how does it differ from a text file?
26. What is the correct order of operations for writing data to a file?
27. EOL can be expanded as
28. Which character can work as delimiter for CSV files:
29. What happens to the content of a file when opened in 'WRITE' mode?
30. Which file type is more secure?
31. Which function returns the current position of file pointer?
32. Which PHP function is used to open a file for reading or writing?
33. What is involved in the process of writing to a file?
34. Files are kept in secondary storage
35. A function can return
36. What will be the output of following codevoid main { ofstream out ..... obj; out ..... obj.open ("abc.txt"); out ..... obj << "MOOCS" << endl;cout << "Data written to file" << endl;out ..... obj.close(); }
37. Which of these packages contain classes and interfaces used for input & output operations of a program?
38. What is the actual use of ofstream?
39. Which method is used to open a file in Python?
40. A logical group of related objects are known as
41. ..... In this type of file, there is no terminator for a line and the data is stored after converting it into machine understandable binary language.
42. What is the last thing you should do to a file?
43. Which attribute provides information about a file object in Python?
44. What does the program that reads from a file do?
45. What is the default mode for opening a file in Python?
46. Apa yang dilakukan fungsi fclose?
47. Can you read a CSV file using the same method as reading a text file in Python?
48. How do you read a single line from a file using Python?
49. Apa yang dilakukan mode "a" saat membuka file?
50. When we open file in reading mode the initial position of the cursor is-
51. What is the purpose of the 'with' statement when opening files?
52. Which of the following is NOT a valid file mode in Python?
53. What is the correct syntax to open a file for reading?
54. Which method is used to write a sequence of strings to a file in Python?
55. Apa yang akan terjadi jika fopen gagal membuka file?
56. The common separated value file extension are .....
57. What does appending to a file do?
58. Describe how to write data to a text file in Python.
59. Which method is used to get the current position of the file handle?
60. What will feof() return when the end of file is reached in C?