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 82hard
What will be the output of the following C code if the value of 'p' is 10 and that of 'q' is 15?
#include<stdio.h>
int main()
{
int p,q;
printf("Enter two numbers\n");
scanf("%d",&p);
scanf("%d",&q);
#if(4<2)
printf("%d",p);
#elif(2>-1)
printf("%d",q);
#else
printf("bye");
#endif
}Question 83easy
What will be the output of the following C code?
#include <stdio.h>
#define p( n ) printf( "t" #n " = %d", t##n )
int t3=10;
int main()
{
p(3);
}Question 84easy
What will be the output of the following C code?
#define hello(c) #c
main()
{
printf(hello(i,am));
}Advertisement
Question 85medium
Which of the following attributes is used to specify that the minimum required memory to be used to represent the types?
Question 86easy
What will be the output of the following C code?
#include<stdio.h>
#define ram 557
int main()
{
#ifndef ram
printf("yes");
#endif
printf("no");
}Question 87easy
The correct syntax of the attribute packed is . . . . . . . .
Advertisement
Question 88easy
What will be the output of the following C code?
#define hello(c,d) #c #d
main()
{
printf(hello(i,"am"));
}Question 89easy
What will be the output of the following C code?
#define display(a) #a
main()
{
printf(display("56#7"));
}Question 90medium
What will be the output of the following C code?
#include<stdio.h>
#pragma GCC poison printf
main()
{
printf("example");
return 0;
}