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
11. The default stream pointers available during execution of a program is
- stdin
- stdout
- stderr
- all the above
12. The function call fopen ("data", "w+b")
- is invalid
- returns the file pointer pointing to file named data and opern the file for reading and writing using binary stream
- returns the file pointer pointing to file named data and opens the file for reading and writing using text stream
- does not return file pointer
14. The function fclose ( ) is
- used to disconnect a program from file
- used to close a file logically
- both options a and b
- a mandatory function call in file handling
15. The action of connecting a program to a file is obtained by using I
- connect ( )
- fopen ( )
- OPEN ( )
- file ( )
16. The action of disconnecting a program from a file is obtained by the function
- fclose ( )
- delete ()
- fdisconnect ()
- clear ( )
18. The value returned by fclose ( ) for successful closing of a file is
- 0
- 1
- EOF
- OK
19. The function(s) used for reading a character from a file is (are)
- ggetc()
- fgetc()
- both options a and b
- fgetchar()
20. The function(s) used for reading formatted input data from a file is (are)
- putc( )
- fputc( )
- both options a and b
- fputchar ( )