C - Files and Preprocessors Questions and Answers
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( )
22. The function used for random access of a file is
- fsek( )
- ftell( )
- search()
- rewind()
23. What is the value of origin used in fseek(fptr, position, origin);? to represent end of file
- 0
- 1
- 2
- EOF
24. What is the value of origin used in fseek(fptr, position, origin);? to represent the beginnin of the file
- 0
- 1
- 2
- START
26. The value returned by fseek ( ) on successful action is
- non-zero
- zero
- OK
- READY
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
28. The value returned by successful the current file position
- -1
- 0
- long int value representing the current file position
- MAX_INT
29. The value returned by ftell ( ) if an erro occurs is
- -1
- 0
- psitive value
- MIN_INT
30. The function call fseek(fp, 0, 0) is same as
- fp = fopen ( )
- rrewind (fp);
- fclose (fp);
- ftell (fp);