12th Class Class Computer Mcqs Chapter No 14 | 2nd Year Computer Mcqs Chapter Wise Pdf
Chapter No 14
File Handling in C
1. A file is stored in choose which one is correct:
- RAM
- Hard Disk
- ROM
- Cache
2. Which of the following function is used to write a string to a file choose which one is correct?
- puts( )
- pute( )
- fputs( )
- fgets( )
3. On successfully closing a file , the fclose( ) returns choose which one is correct:
- NULL
- 0
- 1
- file pointer
4. An array subscript should be
- int
- float
- double
- an array
5. A data file a stored in choose which one is correct:
- RAM
- hard disk
- EEPROM
- None
6. Which of the following mode open only an existing file for both reading and writing choose which one is correct?
- “w”
- “w+”
- “r+”
- “a+”
7. function is used to write a string to a file choose which one is correct:
- puts()
- putc()
- fputs()
- fgets()
8. To store data for future use it must be stored on _____________
- RAM
- ROM
- Secondary Storage
- All of Above
9. A collection of related records is called __________
- Data
- Field
- Database
- File
10. A logical interface to a file is called ____________.
- I/O
- File I/O
- Stream
- Pointer
11. A stream is associated with a file using and ________operaton
- Association
- Attach
- Link
- Open
12. function is used to read a single character from a file at a time choose which one is correct:
- fscanf()
- getch()
- fgetc()
- fgetc()
13. function is used as formatted output file function choose which one is correct:
- printf()
- fprintf()
- puts()
- fputs()
14. If programs get input data from data file and also send output into data file. It is called choose which one is correct:
- files
- file processing
- data files
- file handling
15. There are ___ types of streams
- 1
- 2
- 3
- Many
16. In file handling sequence of characters refers to __________
- Text Stream
- File Stream
- Binary Stream
- Character Stream
17. In text stream characters have _________ correspondence
- One to One
- One to Many
- Many to One
- All of above
18. In binary stream bytes have ______________correspondence
- One to one
- One to Many
- Many to One
- All of Above
19. In text file, data is stored in choose which one is correct:
- ASCII code
- Binary code
- Octal code
- text code
20. is true about a stream choose which one is correct:
- It is a general name given to a flow of data
- It is simply a sequence of bytes.
- It is a logical interface to data files.
- All of these
21. In character conversion
- text stream
- binary stream
- output stream
- input stream
22. In file handling sequence of bytes refers to __________
- Text Stream
- File Stream
- Binary Stream
- Character Stream
23. A text file is a _________ collection of characters
- Fresh
- Old
- Named
- All of Above
24. To mention end of file point a marker______ is used
- File End (FE)
- End File(EF)
- End of File(EF)
- End of File(EOF)
25. To open a file __________ function is used
- open()
- fileopen()
- fopen()
- All of Abvoe
26. represents the new-line marker choose which one is correct:
- ‘\t’
- ‘\n’
- ‘\r’
- ‘\0’
27. The data type of file pointer is choose which one is correct:
- int
- double
- void
- FILE
28. mode can be used to read data from the data file choose which one is correct:
- “r”
- “a”
- “w”
- None
29. modes can be used to read and write data to and from the data file choose which one is correct:
- “r+”
- “a+”
- “w+”
- All of these
30. fopen() function take _____ parameters
- 1
- 2
- 3
- 4
31. In the absolute path of a file we use_______
- /
- \
- \\
- //
32. To open a file for writing if it already exists
- W
- r+
- r
- read
33. Which one is true about pointer type variable
- It holds the data
- It holds the information
- It holds the address of a memory location
- It hold the name of a location
34. Which of the following is ca consecutive group of memory locations with the same name and type choose which one is correct?
- Simple variable
- Structure
- Array
- Pointer
35. An array index / subscript must be of data type choose which one is correct:
- int
- double
- float
- All of these
36. A file can be closed using _________ funciton
- close()
- fclose()
- fileclose()
- None of Above
37. To write a character on a file ________ function is used
- write()
- fwrite()
- put()
- putc()
38. To write a character on a file function takes ________ parameters
- 0
- 1
- 2
- 3
39. The index of an element is written within choose which one is correct:
- curly brackets { }
- parentheses ( )
- square breakles [ ]
- angle brackets < >
40. The elements of array abc [10] is numbered from choose which one is correct:
- 1 to 10
- −5 to 5
- 0 to 9
- 0 to 10
41. assignment statements assigns value to the first element of an array a choose which one is correct:
- a = 15;
- a[0] = 15;
- a [1] = 15;
- All of these
42. Which one is not a valid parameter of putc() function
- File Name
- Character
- File Pointer
- All of Above