C - Files and Preprocessors Questions and Answers
Practice ModeShowing 10 of 96 questions
Q51
Identify the trigraph sequence for ^.
Answer: Option C
Q52
Which of the following is valid for opening a read-only ASCII file ?
Answer: Option B
Q53
What are two predefined FILE pointers in C?
Answer: Option A
Q54
vaoid listfiele (FILE *f)
{
int C;
while ( C = fgetc( f ) ! = EOF)
{
printf ("%d",c);
}
printf ("\n");
}
What will be printed when the function above is called with pointer to an open file that contains the three characters abc ?
Answer: Option B
Q55
How could stderr be redirected from withing a program to force all error messages to be written to the end of the text file "error. log" instead of the location specified by the operating system ?
Answer: Option D
Q56
Which of the following would properly define a macro that doubled any expression passed to it ?
Answer: Option C
Q57
What will be the value of j in the following code ?
# define CATCH (a) a + 1
int i = 2;
int j = 4 * CATCH (I * 3);
Answer: Option B
Q58
Which of the following preprocessor directives will make the system-dependent constant INT_MAX available for an ANSI Ccompiler ?
Answer: Option A
Q59
Which of the following is NOT a pre-processor directive ?
Answer: Option C
Q60
Which of the following is NOT a pre-processor directive ?
Answer: Option D