Question 1 of 25
Hints left: 3
Q1
The C-preprocessors are specified with . . . . . . . . symbol.
Q2
What will be the output of the following C code? #include <stdio.h> void main() { m(); m(); } void m() { static int x = 5; x++; printf("%d", x); }
Q3
What will be the output of the following C code if these two files namely test.c and test1.c are linked and run? -------file test.c------- #include <stdio.h> #include ""test.h"" int main() { i = 10; printf(""%d "", i); foo(); } -----file test1.c------ #include <stdio.h> #include ""test.h"" int foo() { printf(""%d\n"", i); } -----file test.h----- #include <stdio.h> #include <stdlib.h> static int i;
Q4
What will be the output of the following C code? #include <stdio.h> int *i; int main() { if (i == NULL) printf("true\n"); return 0; }
Q5
What is the scope of a function?
Q6
What will be the output of the following C code? #include <stdio.h> double i; int main() { printf("%g\n",i); return 0; }
Q7
What will be the output of the following C code? #include <stdio.h> void main() { static int x; printf("x is %d", x); }
Q8
Which of the following function declaration is illegal?
Q9
#include <somefile.h> are . . . . . . . . files and #include "somefile.h" . . . . . . . . files.
Q10
Comment on the following 2 C programs. #include <stdio.h> //Program 1 int main() { int a; int b; int c; } #include <stdio.h> //Program 2 int main() { int a; { int b; } { int c; } }
Q11
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; }
Q12
What will be the output of the following C code? #include <stdio.h> int *i; int main() { if (i == 0) printf("true\n"); return 0; }
Q13
What will be the output of the following C code (after linking to source file having definition of ary1)? #include <stdio.h> int main() { extern ary1[]; printf("%d\n", ary1[0]); }
Q14
Which of the following are C preprocessors?
Q15
What will be the output of the following C code? #include <stdio.h> #define foo(m, n) " m ## n " int main() { printf("%s\n", foo(k, l)); }
Q16
What will be the output of the following C code? #include <stdio.h> #define foo(m, n) m ## n void myfunc(); int main() { myfunc(); } void myfunc() { printf("%d\n", foo(2, 3)); }
Q17
If the file name is enclosed in angle brackets, then . . . . . . . .
Q18
What will be the output of the following C code? #include <stdio.h> int main() { int one = 1, two = 2; #ifdef next one = 2; two = 1; #endif printf("%d, %d", one, two); }
Q19
What will be the output of the following C code? #include <stdio.h> void main() { #define max 37; printf("%d", max); }
Q20
The "else if" in conditional inclusion is written by?
Q21
What will be the output of the following C code? #include <stdio.h> void func(); int main() { static int b = 20; func(); } void func() { static int b; printf("%d", b); }
Q22
What will be the output of the following C code? #include <stdio.h> void m() { printf("hi"); } void main() { m(); }
Q23
What will be the output of the following C code snippet? #include (stdio.h) void main() { printf("hello"); }
Q24
Register storage class can be specified to global variables.
Q25
What will be the output of the following C code? #include <stdio.h> #define Cprog int main() { int a = 2; #ifdef Cprog a = 1; printf("%d", Cprog); }