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

Quiz Instructions

Select an option to see the correct answer instantly.

1. Which method is used to deserialize object from binary file?
2. Apa yang terjadi apabila user mencoba membuka file yang tidak tersedia dengan menggunakan fungsi open() dan mode "x" ?
3. How can you write data to a file in binary mode?
4. The separator character which is used in csv file is called as .....
5. Which of the following is a benefit of using the 'with' statement for file operations?
6. Which of the following is not a file handling method
7. What does the "x" mode do when opening a file in Python?
8. Can we read file without opening. (T/F)
9. How do you write "Hello, world!" to a file in Python?
10. Try:a=10/5 print (a) except ArithmeticError:print ("This statement is raising an exception" )finally:print (" final block executed '' )
11. A collection of characters that is written or read during file handling in C++ is called
12. I want an array that stores values between 2 and 5, which of the following is correct?
13. Which mode truncates the file to zero length?
14. Which function is used to read single line from file?
15. While appending the data to the binary file, the mode should be .....
16. What is the main purpose of file handling in programming?
17. What is the purpose of the 'struct' module in binary file handling?
18. Discuss the importance of error handling in file operations in Python.
19. What happens when a piece of data is written to a file?
20. Function used to read all the content of file in the form of list:
21. A CSV file is also known as a
22. Which are the different ways to read data from the keyboard?
23. What is the method used to reassign the standard input stream in Python?
24. Fprintf() is used to write:
25. Which mode specifier will erase the contents of a file if it already exists and create it if it does not exist?
26. How do you read a text file line by line in Python?
27. The ..... and ..... functions work identically with the text file as well as binary file
28. Which of the following function you can use to write data in the binary format?
29. Which method returns the absolute pathname of a file?
30. How do you close a file in C++?
31. Urutan langkah file yang benar menurut gambar adalah apa?
32. What is the output of the following recursive function?def countdown(n):if n <= 0:print("Blastoff!")else:print(n, end=" ")countdown(n-1)countdown(5)
33. To close a file we use:
34. What is the purpose of the 'writeline' function?
35. Which statement is true regarding the use of loops in file handling?
36. What is the extension for binary files?
37. Class IT{static public void main(String ..... args){int k=Integer.parseInt(args[0]);System.out.println(k);}}if args[0]="gec" then what type of exception is thrown by the above program.
38. Which function is used to move pointer to a specific byte?
39. What is the difference between reading and writing to a file?
40. Pointer to structure uses:
41. What is the Binary file mode for the Description read and write?
42. What happens if you use fopen("newfile.txt", "w") on a non-existing file?
43. What will be the output of the following C code? #include int main() { FILE *fp = stdout; int n; fprintf(fp, "%d ", 45); fflush(stdout); fprintf(stderr, "%d", 65); return 0; }
44. ..... is the inverse of Pickling where a byte stream is converted into an object hierarchy.
45. Which of the following is not a known file type?
46. What is a file path?
47. What type of file access jumps directly to any piece of data in a file without reading the data that came before it?
48. How do you change the file position to an offset value from the start?
49. Which of the following is a step in file handling?
50. What will be the output of the following code snippet?f=open('xyz.txt', 'r')x=f.read()f.close()print(x)
51. What is the output of the following code?def func(a, b=10, c=20):return a + b + cresult = func(5, c=15)print(result)
52. What command can you use to send back data from a function?
53. Koju metodu koristimo za zatvaranje streama preko objekta file u C++?
54. Which method in the csv module is used to write a single row to a csv file?
55. Which function is used to open a file in C++ for reading or writing?
56. What does the 'W' parameter signify in the 'open' command when opening a file in Python?
57. Which module is used to serialize objects in Python?
58. How can you ensure user input is treated as a string?
59. What is the correct syntax of open() function?
60. Apa yang harus dilakukan setelah selesai menggunakan file?