Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C code? #include <stdio.h> #define p( n,m ) printf( "%d", m##n ) int main() { p(3,4); }
Q2
The following C code results in an error. #include <stdio.h> #define world( n ) printf( "t^^" #n" = %c", t##n ) int t3=1; int main() { world(3); }
Q3
What will be the output of the following C code? #define example(s,n) #s #n main() { printf(example(hello,world)); }
Q4
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); }
Q5
The preprocessor directive which checks whether a constant expression results in a zero or non-zero value . . . . . . . .
Q6
What will be the output of the following C code? #include<stdio.h> #define max 100 main() { #ifdef max printf("hello"); }
Q7
#pragma GCC poison should be followed by a list of identifiers that are . . . . . . . .
Q8
What will be the output of the following C code? #include <stdio.h> #define p( n,m ) printf( "%d", m##n ) #define q(a,b) printf("%d",a##b) main() { p(3,4); q(5,6); }
Q9
What will be the output of the following C code? #define HELLO(a) #a main() { printf(HELLO(good morning)); }
Q10
Which of the following operators is used to concatenate two strings without space?
Q11
What will be the output of the following C code? #define display(text) printf(#text "@") main() { display(hello.); display(good morning!); }
Q12
What will be the output of the following C code? #include<stdio.h> #define hello main() { #ifdef hello #define hi 4 #else #define hi 5 #endif printf("%d",hi); }
Q13
What will be the output of the following C code? #include <stdio.h> #define p( n ) printf( "t%%\n" #n " = %d", t##n ) int t3=10; int main() { int x; x=p(3); }
Q14
The function of __attribute__((packed)); can also be performed using . . . . . . . .
Q15
In the directive, #pragma pack(n), which of the following is not a valid value of n?
Q16
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); }
Q17
What will be the output of the following C code? #include <stdio.h> #define hello( n ) a##n int a3; int main() { int x; x=hello(3); if(x!=0) printf("hi"); else printf("good"); }
Q18
What will be the output of the following C code? #include<stdio.h> void main() { #ifndef max printf("hello"); #endif printf("hi"); }
Q19
What will be the output of the following C code? #define F abc #define B def #define FB(arg) #arg #define FB1(arg) FB(arg) main() { printf(FB(F B)); FB1(F B); }
Q20
The preprocessor directive which is used to remove the definition of an identifier which was previously defined with #define?
Q21
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); }
Q22
The preprocessor directive used to give additional information to the compiler, beyond which is conveyed in the language . . . . . . . .
Q23
What will be the output of the following C code? #include<stdio.h> void f() { #define sf 100 printf("%d",sf); } int main() { #define sf 99; f(); printf("%d",sf); }
Q24
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); }
Q25
Which of the following is not a preprocessor directive?