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

Quiz Instructions

Select an option to see the correct answer instantly.

1. (1) which do we use to output information to a file opened under w/a mode? (2) what data type does it accept as an argument?
2. Which of the following is method for testing whether the specified element is a file or a directory?
3. The ..... statement means to place the file pointer at 30 bytes behind(backward direction) from end of file.
4. Which file extension is used for a plain text file?
5. To iterate through an array in a file, I would use
6. Choose the right statement for fscanf() and scanf()
7. What is the correct way to write to a file in Python?
8. Exception classes belongs to following package
9. What is the correct function to read a specific number of bytes from an open file?
10. What type of objects allow us to use the "with" term?
11. A ..... governs the type of operations(eg read/write/append) possible in the opened file.The two types of data files can be ..... files and ..... files.
12. Files store data permanently in a/ an
13. Which of the following statements is correct regarding the seek() method?
14. Module used to read and write into binary files
15. In the data hierarchy, it is also considered as the Binary.
16. What will be the output of the following C code? (Given that the size of array is 4 and new size of array is 5)#include#includemain(){ int *p, i, a, b; printf("Enter size of array: "); scanf("%d", &a); p=(int*)malloc(a*sizeof(int)); for(i=0;i
17. Which of the following functions do use use to write data in the binary format .....
18. Which function is used to read the content of Binary files?
19. 'r' mode overwrites any data in the file
20. Which mode will create a file only if it doesn't already exist?
21. Assertion:Python is said to have broadly two types of files-binary and text files, even when there are CSV and TSV files also Reason:The CSV and TSV are types of delimited text only where the delimiters are common and tab respectively.
22. If file is opened in "ab" mode, what happens?
23. Which keyword is used to catch exceptions in Python?
24. In Python how many function that help you manipulate the position of file pointer
25. What will happen if you try to open a non-existent file in read mode?
26. How do you read a specific row from a CSV file?
27. With open("hello.txt", "w") as f:f.write("Hello World how are you today") with open('hello.txt', 'r') as f:data = f.readlines() for line in data:words = line.split() print (words) f.close()
28. What is the output of 'os.path.abspath('.')'?
29. Opening a file with write access causes the contents of the file to removed first.
30. Which function is used to read all characters and return it in form a string?
31. The text files stores information in the form of .....
32. What does the 'os.path.getsize()' function return?
33. The two writing functions for python text files are ..... and .....
34. When reading a line from a text file called file.txt into a variable called linetext, which of the following should we use?
35. What does the 'READ' mode do when a file is opened in this mode?
36. Fwrite() returns:
37. What is virtual memory and how does it work?
38. The method to set the file marker position.
39. The ..... statement is used to execute as a pair operations.
40. Which function is used to delete a file?
41. Which functions is used to write all the characters?
42. How many file objects would you need to manage the following situations:(a) to process four files sequentially (b) To process two sorted files into third file
43. If mode argument not passed, then Python will assume it to be ..... by default
44. Which statement(s) is/are true to open a binary file "Record.dat" for reading and writing?
45. Name the error which occurs if the file does not exist when it is opened in 'r' mode
46. If there is fopen function in program then there should always be
47. How do you release dynamically allocated memory in C using free()?
48. What is the difference between FileWriter and Fileoutputstream in Java?
49. The ..... statement is a statement which combines the opening of your file and the processing of a file along multiple exception handling.
50. When should you use the flush() function in Python file handling?
51. Reyansh is working on a project where he needs to save the results of his experiments in a structured format. He decides to use a CSV file for this purpose. What does the csv.writer() function do?
52. ..... is the process of converting Python object hierarchy into a byte stream so that it can be written to a file
53. Which method is used to list all files and directories in a directory in Python?
54. What is the key function for working with files in Python?
55. Flush() is used to
56. What is the Output of following program?#include int main(){ int x = 5; int * const ptr = &x; ++(*ptr); printf("%d", x); return 0; }
57. If CSV contains values like "New, Delhi", how is it handled?
58. The prefix r in front of a string makes it raw string that means .....
59. What is the default mode in which a file is opened using open()?
60. ..... file is used to transfer data from one application to another