C Preprocessor MCQs

93 questionsC-ProgramPage 4 of 11

Practice free C Preprocessor multiple-choice questions with instant answer feedback and step-by-step solutions. Click an option to check yourself, reveal the full explanation, and work through all 93 questions — no login required.

Question 28easy
In C preprocessing, what is the purpose of the #elifndef directive?
Question 29easy
What is the result of the #pragma warning directive in C preprocessing?
Question 30easy
In C, what is the purpose of the #line directive?
Advertisement
Question 31easy
C preprocessor
Question 32easy
A preprocessor command
Question 33easy
What will be the output of the program?
#include<stdio.h>
#define int char 
void main()
{
      int i = 65;
      printf("sizeof(i)=%d", sizeof(i));
}
Advertisement
Question 34easy
What will be the output of the following program?
#include<stdio.h>
#define square(x) x*x 
void main()
{ 
      int i; 
      i = 64/square(4); 
      printf("%d", i); 
}
Question 35easy
What will be the output of the program code?
#include<stdio.h>
#define a 10
void main()
{
      #define a 50
      printf("%d", a);
}
Question 36hard
Choose the correct statement. I. The scope of a macro definition need not be the entire program. II. The scope of a macro definition extends from the point of definition to the end of the file. III. New line is a macro definition delimiter. IV. A macro definition may go beyond a line.