Question 1 of 25
Hints left: 3
Q1
What does the 'sizeof' operator in C return for a union?
Q2
The correct syntax of the attribute packed is . . . . . . . .
Q3
The pragma . . . . . . . . is used to remove an identifier completely from a program.
Q4
What will be the output of the following C code if the value of 'p' is 10 and that of 'q' is 15? #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 }
Q5
What will be the output of the following C code? #include<stdio.h> #pragma GCC poison printf main() { printf("example"); return 0; }
Q6
Which of the following can be a member of a structure?
Q7
What will be the output of the following C code? #include<stdio.h> #define ram 557 int main() { #ifndef ram printf("yes"); #endif printf("no"); }
Q8
Which of the following attributes is used to specify that the minimum required memory to be used to represent the types?
Q9
Which statement correctly defines a structure named "Person" with members "name" and "age" of type char* and int respectively?
Q10
What will be the output of the following C code? #include<stdio.h> #define ram 10 main() { #ifdef ram #define ram 20 #endif printf("%d",ram); }
Q11
What is the keyword used to define a structure in C?
Q12
Which keyword is used to declare a union in C?
Q13
What is the primary difference between a structure and a union in C?
Q14
What will be the output of the following C code? #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 }
Q15
In a structure, what are the members also known as?
Q16
What will be the output of the following C code? #define sqr(x) x*x main() { int a1; a1=25/sqr(5); printf("%d",a1); }
Q17
What will be the output of the following C code? #define hello(c,d) #c #d main() { printf(hello(i,"am")); }
Q18
Which of the following is a stringizing operator?
Q19
How do you access a member of a structure in C?
Q20
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() { p(3); }
Q21
What will be the output of the following C code? #define display(a) #a main() { printf(display("56#7")); }
Q22
What will be the output of the following C code? #define hello(c) #c main() { printf(hello(i,am)); }
Q23
Can a structure have another structure as a member in C?
Q24
How is the size of a structure determined in C?
Q25
The purpose of the preprocessor directive #error is that . . . . . . . .