Class 11 Computer Science Chapter 6 File Handling Quiz 49 (25 MCQs)

Quiz Instructions

Select an option to see the correct answer instantly.

1. Choose the right statement for fscanf() and scanf()
2. What is the correct way to write to a file in Python?
3. Exception classes belongs to following package
4. What is the correct function to read a specific number of bytes from an open file?
5. What mode should be used to open a file for reading in Python?
6. What type of objects allow us to use the "with" term?
7. 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.
8. Files store data permanently in a/ an
9. Which of the following statements is correct regarding the seek() method?
10. Module used to read and write into binary files
11. In the data hierarchy, it is also considered as the Binary.
12. 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
13. Which of the following functions do use use to write data in the binary format .....
14. Which function is used to read the content of Binary files?
15. 'r' mode overwrites any data in the file
16. How can you write data to a text file in Python?
17. Which mode will create a file only if it doesn't already exist?
18. 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.
19. If file is opened in "ab" mode, what happens?
20. Which keyword is used to catch exceptions in Python?
21. In Python how many function that help you manipulate the position of file pointer
22. What will happen if you try to open a non-existent file in read mode?
23. How do you read a specific row from a CSV file?
24. 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()
25. What is the data type of data read from a file?