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
31. The function used for reading binary stream is
- read ( )
- fread ( )
- fscanf ( )
- all the above
32. Identify the functions for in-memory for mat conversions
- realloc ( )
- sprintf ( )
- sscanf( )
- both options b and c
33. The value of string after exeecuting the following statements is int x = 25; char string [5]; sprintf ( string, "%d", x);
- "25"
- 25
- TWO FIVE
- 25000
34. The value of ch after executing the following statements is int x; char ch; char string [20] = "100 5"; sscanf (string, "%3d%d", &x, &ch);
- 5
- blank
- "5"
- NULL
35. Identify the correct statement.
- # include "filename"
- #include <filename>
- both options a and b
- #include filename
36. The following line in a program # represents
- an invalid code
- a null dirrective
- a comment
- a page number
37. Macros
- can be recursively defined
- cannot be recursively defined
- cannot be defined
- are not preprocessor facility
40. The directive (s) used in conditional compilation is (are)
- #if
- #elif
- #else
- all the above