12th class (Fsc) computer unit 14 MCQs
chapter 14 MCQs 12th Class computer
File Handling in “C”:
1. A file is stored in:
a. ROM
b. RAM
c. Cache
d. Hard Disk
2. The character conversion may occur in:
a. Input stream
b. Text stream
c. Output stream
d. Binary stream
3. A sequence of characters from an input device to computer is called:
a. Binary stream
b. Input stream
c. Output stream
d. Text stream
4. Which of the following mode open only an existing file for both reading and writing:
a. “r+”
b. “w”
c. “a+”
d. “w+”
5. fopen() function takes ……… parameters.
a. 3
b. 1
c. 4
d. 2
6. In the statement FILE * represents:
a. Argument
b. Variable
c. Pointer
d. Parameter
7. In the statement FILE *fp , the * represents:
a. Argument
b. Multiplication
c. Sentinal
d. Pointer
8. On successfully closing a file, the fclose() returns:
a. 1(one)
b. NULL
c. FILE pointer
d. 0(zero)
9. On successful closing a file, the fclose() returns:
a. 1 (One)
b. Null
c. File pointer
d. 0 (Zero)
10. Which mode opens only an existing file for both reading and writing?
a. “r+”
b. “w”
c. “a+”
d. “w+”
11. Which of the following functions is used to read character from a file?
a. fputs()
b. getc()
c. fgets()
d. putc()
12. Which of the following function is used to write string to a file?
a. fputs()
b. getc()
c. fgets()
d. putc()
13. Which of the following functions is used to write character to a file?
a. Fputs()
b. Putc( )
c. Fgets()
d. Putc()
14. An array subscript should be:
a. double
b. Int
c. An array
d. Float
15. Which of the following character is used to mark the end of the string?
a. \a
b. \0
c. \n
d. /0
16. Which of the following function is used to copy a string to an array of characters:
a. Strycp
b. Strcpy
c. Strpcy
d. None
17. Which of the following functions is used to write a string to a file?
a. Fputs()
b. Puts()
c. Fgets()
d. Pute()
18. If fptr=fopen (“data.txt”,”r”) statement is used to open a file then what would be the necessary condition?
a. The file must contain valid student data
b. The file must already exist
c. The type of file must be read only
d. The file should be data file only
19. Which of the following are file handling functions?
a. Fprintf( )
b. Fscanf()
c. Both A & B
d. None
Click here to go directly on chapter no.1