C - Files and Preprocessors

C - Files and Preprocessors
21. The function (s) used for reading formatted input data from a file is (are)
  • getchar ()
  • fscanf( )
  • scanf()
  • gets( )
Show Answer
22. The function used for random access of a file is
  • fsek( )
  • ftell( )
  • search()
  • rewind()
Show Answer
23. What is the value of origin used in fseek(fptr, position, origin);?
to represent end of file
  • 0
  • 1
  • 2
  • EOF
Show Answer
24. What is the value of origin used in fseek(fptr, position, origin);?
to represent the beginnin of the file
  • 0
  • 1
  • 2
  • START
Show Answer
25. If an errror occurs, the function fseek() returns
  • non-zero
  • zero
  • no value
  • -1
Show Answer
26. The value returned by fseek ( ) on successful action is
  • non-zero
  • zero
  • OK
  • READY
Show Answer
27. The function ftel (fptr) returns
  • the beginning position of the file represented by fptr
  • the end position of the file represented by fptr
  • the current position of the file represented by fptr
  • the middle position of the file represented by fptr
Show Answer
28. The value returned by successful the current file position
  • -1
  • 0
  • long int value representing the current file position
  • MAX_INT
Show Answer
29. The value returned by ftell ( ) if an erro occurs is
  • -1
  • 0
  • psitive value
  • MIN_INT
Show Answer
30. The function call fseek(fp, 0, 0) is same as
  • fp = fopen ( )
  • rrewind (fp);
  • fclose (fp);
  • ftell (fp);
Show Answer
Questions and Answers for Competitive Exams Various Entrance Test