C - Files and Preprocessors Questions and Answers

Take Exam

C Files and Preprocessors Questions with Answers are essential for mastering file handling, macros, and directives in C programming. As part of programming questions and answers for placement exams, this topic helps students understand real-world input/output operations and code optimization techniques. Frequently asked in TCS, Wipro, and Capgemini tests, these questions assess how well you manage data files and preprocess instructions efficiently. Practicing these C programming MCQs with solutions improves your coding proficiency and exam accuracy. Access free C file handling and preprocessor aptitude questions with explanations in PDF or attempt our online mock test.

C - Files and Preprocessors

Showing 10 of 96 questions

21. The function (s) used for reading formatted input data from a file is (are)

  • getchar ()
  • fscanf( )
  • scanf()
  • gets( )
Show Answer Report

22. The function used for random access of a file is

  • fsek( )
  • ftell( )
  • search()
  • rewind()
Show Answer Report

23. What is the value of origin used in fseek(fptr, position, origin);? to represent end of file

  • 0
  • 1
  • 2
  • EOF
Show Answer Report

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 Report

25. If an errror occurs, the function fseek() returns

  • non-zero
  • zero
  • no value
  • -1
Show Answer Report

26. The value returned by fseek ( ) on successful action is

  • non-zero
  • zero
  • OK
  • READY
Show Answer Report

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 Report

28. The value returned by successful the current file position

  • -1
  • 0
  • long int value representing the current file position
  • MAX_INT
Show Answer Report

29. The value returned by ftell ( ) if an erro occurs is

  • -1
  • 0
  • psitive value
  • MIN_INT
Show Answer Report

30. The function call fseek(fp, 0, 0) is same as

  • fp = fopen ( )
  • rrewind (fp);
  • fclose (fp);
  • ftell (fp);
Show Answer Report
Questions and Answers for Competitive Exams Various Entrance Test