Select an option to see the answer and solution.
C Preprocessor
practice.
Practice every MCQ with options. Use Show answers when you want the correct option and solution.
93
Questions
5/5
Page
Pick an option on a question to see the right answer and solution.
#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
}Select an option to see the answer and solution.
#include <stdio.h>
#define p( n ) printf( "t" #n " = %d", t##n )
int t3=10;
int main()
{
p(3);
}Select an option to see the answer and solution.
#define hello(c) #c
main()
{
printf(hello(i,am));
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include<stdio.h>
#define ram 557
int main()
{
#ifndef ram
printf("yes");
#endif
printf("no");
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
#define hello(c,d) #c #d
main()
{
printf(hello(i,"am"));
}Select an option to see the answer and solution.
#define display(a) #a
main()
{
printf(display("56#7"));
}Select an option to see the answer and solution.
#include<stdio.h>
#pragma GCC poison printf
main()
{
printf("example");
return 0;
}Select an option to see the answer and solution.
Select an option to see the answer and solution.
#include <stdio.h>
#define hello( n ) printf( "a" #n "= %d", a##n )
int a3=3;
int main()
{
#ifdef a3
hello(3);
#else
printf("sorry");
#endif
}Select an option to see the answer and solution.
#define sqr(x) x*x
main()
{
int a1;
a1=25/sqr(5);
printf("%d",a1);
}Select an option to see the answer and solution.