C - Files and Preprocessors Questions and Answers

Practice Mode
Showing 10 of 96 questions
Q21
The function (s) used for reading formatted input data from a file is (are)
  • A getchar ()
  • B fscanf( )
  • C scanf()
  • D gets( )
Answer: Option B
Q22
The function used for random access of a file is
  • A fsek( )
  • B ftell( )
  • C search()
  • D rewind()
Answer: Option A
Q23
What is the value of origin used in fseek(fptr, position, origin);? to represent end of file
  • A 0
  • B 1
  • C 2
  • D EOF
Answer: Option C
Q24
What is the value of origin used in fseek(fptr, position, origin);? to represent the beginnin of the file
  • A 0
  • B 1
  • C 2
  • D START
Answer: Option A
Q25
If an errror occurs, the function fseek() returns
  • A non-zero
  • B zero
  • C no value
  • D -1
Answer: Option A
Q26
The value returned by fseek ( ) on successful action is
  • A non-zero
  • B zero
  • C OK
  • D READY
Answer: Option B
Q27
The function ftel (fptr) returns
  • A the beginning position of the file represented by fptr
  • B the end position of the file represented by fptr
  • C the current position of the file represented by fptr
  • D the middle position of the file represented by fptr
Answer: Option C
Q28
The value returned by successful the current file position
  • A -1
  • B 0
  • C long int value representing the current file position
  • D MAX_INT
Answer: Option C
Q29
The value returned by ftell ( ) if an erro occurs is
  • A -1
  • B 0
  • C psitive value
  • D MIN_INT
Answer: Option A
Q30
The function call fseek(fp, 0, 0) is same as
  • A fp = fopen ( )
  • B rrewind (fp);
  • C fclose (fp);
  • D ftell (fp);
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test