C - Files and Preprocessors Questions and Answers

Practice Mode
Showing 10 of 96 questions
Q11
The default stream pointers available during execution of a program is
  • A stdin
  • B stdout
  • C stderr
  • D all the above
Answer: Option D
Q12
The function call fopen ("data", "w+b")
  • A is invalid
  • B returns the file pointer pointing to file named data and opern the file for reading and writing using binary stream
  • C returns the file pointer pointing to file named data and opens the file for reading and writing using text stream
  • D does not return file pointer
Answer: Option B
Q13
If fopen ( ) fails, it returns
  • A -1
  • B NULL
  • C 1
  • D the file pointer
Answer: Option B
Q14
The function fclose ( ) is
  • A used to disconnect a program from file
  • B used to close a file logically
  • C both options a and b
  • D a mandatory function call in file handling
Answer: Option C
Q15
The action of connecting a program to a file is obtained by using I
  • A connect ( )
  • B fopen ( )
  • C OPEN ( )
  • D file ( )
Answer: Option B
Q16
The action of disconnecting a program from a file is obtained by the function
  • A fclose ( )
  • B delete ()
  • C fdisconnect ()
  • D clear ( )
Answer: Option A
Q17
The value returned by fclose(), if an error occurs is
  • A 0
  • B 1
  • C EOF
  • D -1
Answer: Option C
Q18
The value returned by fclose ( ) for successful closing of a file is
  • A 0
  • B 1
  • C EOF
  • D OK
Answer: Option A
Q19
The function(s) used  for reading a character from a file is (are)
  • A ggetc()
  • B fgetc()
  • C both options a and b
  • D fgetchar()
Answer: Option C
Q20
The function(s) used for reading formatted input data from a file is (are)
  • A putc( )
  • B fputc( )
  • C both options a and b
  • D fputchar ( )
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test