Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C code having void return-type function? #include <stdio.h> void foo() { return 1; } void main() { int x = 0; x = foo(); printf("%d", x); }
Q2
What is the scope of an automatic variable?
Q3
What will be the output of the following C code? #include <stdio.h> void main() { { int x = 8; } printf("%d", x); }
Q4
If the file name is enclosed in double quotation marks, then . . . . . . . .
Q5
What will be the output of the following C code? #include <stdio.h> #define SYSTEM 20 int main() { int a = 20; #if SYSTEM == a printf("HELLO "); #endif #if SYSTEM == 20 printf("WORLD\n"); #endif }
Q6
Which of the following storage class supports char data type?
Q7
Functions have static qualifier for its declaration by default.
Q8
What will be the output of the following C code? #include <stdio.h> int foo(); int main() { int i = foo(); } foo() { printf("2 "); return 2; }
Q9
What will be the output of the following C code? #include <stdio.h> int foo(int, int); #define foo(x, y) x / y + x int main() { int i = -6, j = 3; printf("%d ",foo(i + j, 3)); #undef foo printf("%d\n",foo(i + j, 3)); } int foo(int x, int y) { return x / y + x; }
Q10
What will be the output of the following C code? #include <stdio.h> int *m(); void main() { int k = m(); printf("%d", k); } int *m() { int a[2] = {5, 8}; return a; }
Q11
The #else directive is used for . . . . . . . .
Q12
What will be the output of the following C code? #include <stdio.h> void foo(); int main() { void foo(); foo(); return 0; } void foo() { printf("2 "); }
Q13
register keyword mandates compiler to place it in machine register.
Q14
Conditional inclusion can be used for . . . . . . . .
Q15
What will be the output of the following C code? #include <stdio.h> void foo(auto int i); int main() { foo(10); } void foo(auto int i) { printf("%d\n", i ); }
Q16
What will be the output of the following C code? #include <stdio.h> int x; void main() { m(); printf("%d", x); } void m() { x = 4; }
Q17
Which of following is not accepted in C?
Q18
Functions can return enumeration constants in C?
Q19
What will be the output of the following C code? #include <stdio.h> #define MIN 0 #if defined(MIN) + defined(MAX) #define MAX 10 #endif int main() { printf("%d %d\n", MAX, MIN); return 0; }
Q20
What will be the output of the following C code? #include <stdio.h> void main() { static int x; if (x++ < 2) main(); }
Q21
Global variables are . . . . . . . .
Q22
Can we use a function as a parameter of another function? [Eg: void wow(int func())].
Q23
Assignment statements assigning value to local static variables are executed only once.
Q24
Automatic variables are initialized to . . . . . . . .
Q25
Comment on the output of the following C code. #include <stdio.h> #define var 20); int main() { printf("%d\n", var }