C Preprocessor MCQs
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 64easy
What will be the output of the following C code?
#include<stdio.h>
#define hello 10
void main()
{
printf("%d",hello);
#undef hello
printf("%d",hello);
}Question 65easy
What will be the output of the following C code?
#include <stdio.h>
#define display( n ) printf( "a" #n " = %d", a##n )
int main()
{
display(3);
}Question 66medium
The preprocessor directive used to give additional information to the compiler, beyond which is conveyed in the language . . . . . . . .
Advertisement
Question 67easy
Which of the following operators is used to concatenate two strings without space?
Question 68medium
#pragma GCC poison should be followed by a list of identifiers that are . . . . . . . .
Question 69medium
In the directive, #pragma pack(n), which of the following is not a valid value of n?
Advertisement
Question 70easy
What will be the output of the following C code?
#include <stdio.h>
#define a 2
main()
{
int r;
#define a 5
r=a*2;
printf("%d",r);
}Question 71easy
What will be the output of the following C code?
#include<stdio.h>
#define max 100
main()
{
#ifdef max
printf("hello");
}Question 72easy
What will be the output of the following C code?
#include<stdio.h>
#define hello 10
main()
{
#ifdef hello
#undef hello
#define hello 100
#else
#define hello 200
#endif
printf("%d",hello);
}