Top

C Preprocessor

Answer: B

No answer description available for this question.

Enter details here

42.

What is the output of this program?

#include 
#define p 17;
int main()
{
  printf("%d",p);
  return 0;
}

 

Answer: D

Preprocessor should not terminate with semicolon.

Enter details here

43.

# include 
# define scanf  "%s Geeks Quiz "
int main()
{
   printf(scanf, scanf);
   return 0;
}

 

Answer: D

No answer description available for this question.

Enter details here

44.

The NULL character indicates an end of a string and a file.

Answer: B

No, The NULL character did not indicates an end of a string and a file.

Enter details here

45.

Once preprocessing is over and the program is sent for the compilation the macros are removed from the expanded source code.

Answer: A

True, After preprocessing all the macro in the program are removed.

Enter details here

46.

What will be the output of the following C code?

#include
void main()
{
    #ifndef max
    printf("hello");
    #endif
    printf("hi");
}

 

Answer: B

The code shown above illustrates the preprocessor directive #ifndef. If the identifier checked is not defined, then the statements following #ifndef are executed. Here, since the identifier max is not defined, the statement after #ifndef is executed. Hence the output is: hellohi

Enter details here

47.

Macros with arguments are allowed

Answer: A

No answer description available for this question.

Enter details here

48.

Which of the following are correctly formed #define statements in C?

Answer: C

No answer description available for this question.

Enter details here

49.

What will be the output of the following C code?

#include
#define san 557
main()
{
    #ifndef san
    printf("yes");
    #endif
    printf("no");
}

 

Answer: C

The output to the above code will be no. Since we have used the preprocessor directive, #ifndef and defined the identifier san, “yes” is not printed. Hence only “no” is printed as output.

Enter details here

50.

The translator which performs macro calls expansion is called:

Answer: C

No answer description available for this question.

Enter details here

Loading…
Tags: C Preprocessor Questions and Answers || C Preprocessor MCQ Questions and Answers || C Preprocessor GK Questions and Answers || C Preprocessor GK MCQ Questions || C Preprocessor Multiple Choice Questions and Answers || C Preprocessor GK || GK on C Preprocessor || C Programming Questions and Answers || C Programming MCQ Questions and Answers || C Programming GK Questions and Answers || GK on C Programming