Question 1 of 25
Hints left: 3
Q1
Which of the following cannot be static in C?
Q2
What will be the output of the following C code? #include <stdio.h> #include "printf" void main() { printf("hello"); }
Q3
What will be the output of the following C code? #include <stdio.h> #define foo(x, y) x / y + x int main() { int i = -6, j = 3; printf("%d ", foo(i + j, 3)); printf("%d\n", foo(-3, 3)); return 0; }
Q4
#include statement must be written . . . . . . . .
Q5
What will be the output of the following C code? #include <stdio.h> static int x = 5; void main() { x = 9; { int x = 4; } printf("%d", x); }
Q6
Is initialisation mandatory for local static variables?
Q7
Functions can return structure in C?
Q8
What will be the output of the following C code? #include <stdio.h> void f(); int main() { #define max 10 f(); return 0; } void f() { printf("%d\n", max * 10); }
Q9
What will be the output of the following C code? #include <stdio.h> int main() { register static int i = 10; i = 11; printf("%d\n", i); }
Q10
What will be the output of the following C code? #include <stdio.h> void main() { m(); printf("%d", x); } int x; void m() { x = 4; }
Q11
Functions in C are always . . . . . . . .
Q12
What is the problem in the following C declarations? int func(int); double func(int); int func(float);
Q13
What will be the output of the following C code? #include <stdio.h> register int x; void main() { printf("%d", x); }
Q14
What will be the output of the following C code? #include <stdio.h> #define A 1 + 2 #define B 3 + 4 int main() { int var = A * B; printf("%d\n", var); }
Q15
What will be the output of the following C code? #include <stdio.h> static int x = 5; void main() { int x = 9; { x = 4; } printf("%d", x); }
Q16
Which of the following function declaration is illegal?
Q17
Can variable i be accessed by functions in another source file? #include <stdio.h> int i; int main() { printf("%d\n", i); }
Q18
What will be the output of the following C code? #include <stdio.h> int main() { foo(); foo(); } void foo() { int i = 11; printf("%d ", i); static int j = 12; j = j + 1; printf("%d\n", j); }
Q19
Automatic variables are allocated memory in . . . . . . . .
Q20
A local variable declaration with no storage class specified is by default . . . . . . . .
Q21
What will be the output of the following C code? #include <stdio.h> int main() { void foo(); void f() { foo(); } f(); } void foo() { printf("2 "); }
Q22
What will be the output of the following C code? #include <stdio.h> void m(int k) { printf("hi"); } void m(double k) { printf("hello"); } void main() { m(3); }
Q23
What is the default return type if it is not specified in function definition?
Q24
What is the advantage of #define over const?
Q25
What will be the output of the following C code? #include <stdio.h> double foo(); int main() { foo(); return 0; } foo() { printf("2 "); return 2; }