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
91. What is the output of the following code ? enum alphanum { VARIABLE=S, DIGIT=10, VARIABLE=11 }; PRINTF("%D", DIGIT);
- Compilation error
- Execution error
- 10
- 6
92. What is the output of the following code ? enum control { on, off, neutral }; PRINTF ("%d", off);
- Compliation error
- Execution error
- 5
- 1
93. identify the correct statement. 1. The typedef defines synonyms for a an existing data type. 2. the typedef creates a new data type that is not existing in C. 3. the typedef helps in easier modification of a portable program. 4. The typedef gives meaningful namels to a data type.
- options 1, 3 and 4
- options 1 and 4
- options 2 and 3
- options 2, 3 and 4
94. Identify the valid data type of the variable fraction in the following code. typedef float HOST; HOST fraction;
- int and HOST
- struct and HOST
- enum and HOST
- float and HOST
95. Given the following declaration, identify the correct definition. typedef struct node { int id; char name [20]; };
- node n;
- NODE n;
- typedef NODE n;
- typedef node n;
96. The purpose of the following code is no find #include < time.. main () { time _t t1, t2; clock _t clock (void) int i,x=0, y=10; for(i=0; i<1000; i++) { xc++; y+=50; printf ("The value of i=%d, x = %d, y = %d\n", i, x, y); } t2 = clock ( ) ; printf ("Time in seconds :%g\n", difftime(t2,t1)/ CLOCKS_PER_SEC); }
- compilation time
- execution time
- difference between GST and IST
- difference between compilation and execution times.