Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C code? #include <stdio.h> void foo(); int main() { void foo(int); foo(); return 0; } void foo() { printf("2 "); }
Q2
What will be the output of the following C code? #include <stdio.h> void main() { static int x = 3; x++; if (x <= 5) { printf("hi"); main(); } }
Q3
Comment on the output of the following C code. #include <stdio.h> int main() { int i; for (i = 0;i < 5; i++) int a = i; printf("%d", a); }
Q4
The preprocessor provides the ability for . . . . . . . .
Q5
What will be the output of the following C code? #include <stdio.h> void main() { static double x; int x; printf("x is %d", x); }
Q6
In C, what is the value of a pointer variable if it hasn't been assigned any address?
Q7
What is the purpose of the '->' operator in C when used with pointers?
Q8
What will be the output of the following C code? #include <stdio.h> void main() { int x = 3; { x = 4; printf("%d", x); } }
Q9
Which of the following is true for the static variable?
Q10
Which of the following sequences are unaccepted in C language?
Q11
Which of the following file extensions are accepted with #include?
Q12
In C, what is a pointer primarily used for?
Q13
What will be the output of the following C code? #include <stdio.h> # define max void m() { printf("hi"); } void main() { max; m(); }
Q14
How is search done in #include and #include "somelibrary.h" according to C standard?
Q15
What is the result of the expression *ptr in C, where ptr is a pointer to an int?
Q16
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; }
Q17
Which of the following operation is not possible in a register variable?
Q18
What will be the output of the following C code? #include <stdio.h> int x = 5; void main() { int x = 3; printf("%d", x); { int x = 4; } printf("%d", x); }
Q19
Which of the following Macro substitution are accepted in C?
Q20
In C, how do you declare a pointer variable that can store the address of an integer?
Q21
Which variable has the longest scope in the following C code? #include <stdio.h> int b; int main() { int c; return 0; } int a;
Q22
What will be the data type returned for the following C function? #include <stdio.h> int func() { return (double)(char)5.0; }
Q23
What is the result of the expression sizeof(int*) in C, assuming an int pointer on a typical system?
Q24
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)); }
Q25
Property which allows to produce different executable for different platforms in C is called?