C Preprocessor - Study Mode
[#76] What will be the output of the following C code, if it is run on a 32 bit platform? #include<stdio.h>
#pragma(1)
struct test
{
int i
char j
}
main()
{
printf("%d",sizeof(struct test))
}
Correct Answer
(D) 8
[#77] What will be the output of the following C code? #include <stdio.h>
#define p( m ) printf( "t*" #m " = %s", t##m )
char tram[]="tram"
int main()
{
int x
x=p(ram)
}
Correct Answer
(D) t*ram=tram
[#78] What will be the output of the following C code? #include<stdio.h>
#define sf 10
main()
{
if(sf==100)
printf("good")
else
{
printf("bad")
sf=100
}
printf("%d",sf)
}
Correct Answer
(D) error
[#79] What will be the output of the following C code? #include<stdio.h>
void main()
{
#ifndef max
printf("hello")
#endif
printf("hi")
}
Correct Answer
(B) hellohi
[#80] 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)
}
Correct Answer
(B) False