Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C code? #include <stdio.h> void main() { #define const int const max = 32; printf("%d", max); }
Q2
What will be the output of the following C code? #include <stdio.h> int *m() { int *p = 5; return p; } void main() { int *k = m(); printf("%d", k); }
Q3
What will be the output of the following C code? #include <stdio.h> #define COLD int main() { #ifdef COLD printf("COLD\t"); #undef COLD #endif #ifdef COLD printf("HOT\t"); #endif }
Q4
Which function definition will run correctly?
Q5
Which among the following is wrong for "register int a;"?
Q6
C preprocessor is conceptually the first step during compilation.
Q7
The #elif directive cannot appear after the preprocessor #else directive.
Q8
How is search done in #include and #include"somelibrary.h" normally or conventionally?
Q9
What will be the output of the following C code? #include <stdio.h> int main() { register int i = 10; int *p = &i; *p = 11; printf("%d %d\n", i, *p); }
Q10
What is the format identifier for "static a = 20.5;"?
Q11
What will be the sequence of allocation and deletion of variables in the following C code? #include <stdio.h> int main() { int a; { int b; } }
Q12
What will be the output of the following C code? #include <stdio.h> int main() { register const int i = 10; i = 11; printf("%d\n", i); }
Q13
#pragma exit is primarily used for?
Q14
Array sizes are optional during array declaration by using . . . . . . . . keyword.
Q15
Preprocessor feature that supply line numbers and filenames to compiler is called?
Q16
What will be the output of the following C code? #include <stdio.h> int i; int main() { extern int i; if (i == 0) printf("scope rules\n"); }
Q17
Which data type can be stored in register?
Q18
What will be the output of the following C code? #include <stdio.h> void main() { register int x = 5; m(); printf("x is %d", x); } void m() { x++; }
Q19
What will be the output of the following C code? #include <stdio.h> void m(); void n() { m(); } void main() { void m() { printf("hi"); } }
Q20
What will be the output of the following C code? #include <stdio.h> void main() { #define max 45 max = 32; printf("%d", max); }
Q21
What will be the output of the following C code? #include <stdio.h> #define MIN 0 #ifdef(MIN) #define MAX 10 #endif int main() { printf("%d %d\n", MAX, MIN); return 0; }
Q22
Which directory the compiler first looks for the file when using #include?
Q23
What will be the output of the following C code? #include <stdio.h> #define foo(m, n) m * n = 10 int main() { printf("in main\n"); }
Q24
What will be the output of the following C code? #include <stdio.h> enum m{JAN, FEB, MAR}; enum m foo(); int main() { enum m i = foo(); printf("%d\n", i); } int foo() { return JAN; }
Q25
What will be the output of the following C code? #include <stdio.h> #define MIN 0); #ifdef MIN #define MAX 10 #endif int main() { printf("%d %d\n", MAX, MIN return 0; }