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

Quiz Instructions

Select an option to see the correct answer instantly.

1. What is the correct definition for a VARIABLE?
2. What is the primary purpose of file handling in programming?
3. Given the following file opened as song ..... file:I can't write one song that's not about youCan't drink without thinkin' about youIs it too late to tell you thatEverything means nothing if I can't have you?What is the result ofprint(song ..... file.read(4))?
4. What does file handling in Python allow you to do?
5. Which of the following error is returned when we try to open a file in read mode which does not exist?
6. What happens if you try to read from a closed file?
7. File can be 'looked at' by the program but not changed. Error if the file doesn't already exist.
8. Assertion:'Pickling' is the process whereby a Python object hierarchy is converted into a byte-streams. Reason:A binary file works with byte-streams.
9. Which function in pseudocode is used to write data to a file?
10. What is the importance of closing a file after file handling operations in Python?
11. Explain how to read a specific number of bytes from a binary file.
12. Predict the output of the following program#include int main()\{ register int i = 10; int *ptr = &i; printf("%d ", *ptr); return 0; \}
13. Which file is not binary file?
14. What are the different access modes available in Python for file handling?
15. How can you read the next line of a file using streaming?
16. Apa nilai default parameter dtype yang dikembalikan oleh fungsi numpy.loadtxt()?
17. What does fread() do?
18. What should a program do to prevent errors when working with files?
19. Which function will read a single line at a time?
20. Which of the following file modes allows both reading and writing without overwriting?
21. What will be the output of the following C code? #include struct student \{ int no; char name[20]; \}; void main() \{ student s; s.no = 8; printf("%d", s.no); \}
22. Which methods will create the file if it is not found?
23. Name and explain at least three CPU scheduling algorithms.
24. Which mode allows us to add data to an existing file?file =open("poem.txt", " ..... ")
25. Apa fungsi dari fopen dalam pemrograman C?