Question 1
#include <stdio.h>
#define PRINT(i, limit) do \\
{ \\
if (i++ < limit) \\
{ \\
printf(\"GeeksQuiz\\n\"); \\
continue; \\
} \\
}while(1)
int main()
{
PRINT(0, 3);
return 0;
}
Question 2
What is the output of following program?
#include <stdio.h>
#define macro(n, a, i, m) m##a##i##n
#define MAIN macro(n, a, i, m)
int MAIN()
{
printf(\"GeeksQuiz\");
return 0;
}
Question 3
#include <stdio.h>
#define X 3
#if !X
printf(\"Geeks\");
#else
printf(\"Quiz\");
#endif
int main()
{
return 0;
}
Question 4
#include <stdio.h>
#define ISEQUAL(X, Y) X == Y
int main()
{
#if ISEQUAL(X, 0)
printf(\"Geeks\");
#else
printf(\"Quiz\");
#endif
return 0;
}
Question 5
#include <stdio.h>
#define square(x) x*x
int main()
{
int x;
x = 36/square(6);
printf(\"%d\", x);
return 0;
}
Question 6
# include <stdio.h>
# define scanf \"%s Geeks Quiz \"
int main()
{
printf(scanf, scanf);
return 0;
}
Question 7
#include <stdio.h>
#define a 10
int main()
{
printf(\"%d \",a);
#define a 50
printf(\"%d \",a);
return 0;
}
Question 8
#include<stdio.h>
#define f(g,g2) g##g2
int main()
{
int var12 = 100;
printf(\"%d\", f(var,12));
return 0;
}
Question 9
#include <stdio.h>
#define MAX 1000
int main()
{
int MAX = 100;
printf(\"%d \", MAX);
return 0;
}
Question 10
#include<stdio.h>
#define max abc
#define abc 100
int main()
{
printf(\"maximum is %d\", max);
return 0;
}
There are 21 questions to complete.