C Preprocessor - Study Mode
[#86] What will be the output of the following C code? #define display(text) printf(#text "@")
main()
{
display(hello.)
display(good morning!)
}
Correct Answer
(D) hello.@good morning!@
[#87] 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()
{
int x
x=p(3)
}
Correct Answer
(A) t% 3=10
[#88] 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)
}
Correct Answer
(A) 4356
[#89] 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)
}
Correct Answer
(C) error
[#90] 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)
}
Correct Answer
(D) error