Question 1 of 25
Hints left: 3
Q1
One of the major difference between typedef and #define is that typedef interpretation is performed by the . . . . . . . . whereas #define interpretation is performed by the . . . . . . . .
Q2
What will be the output of the following C code? #include <stdio.h> void main() { int x = 1, y = 0, z = 5; int a = x && y || z++; printf("%d", z); }
Q3
What will be the output of the following C code? #include<stdio.h> enum hello { a,b=99,c,d=-1 }; main() { enum hello m; printf("%d\n%d\n%d\n%d\n",a,b,c,d); }
Q4
What will be the output of the following C code? #include <stdio.h> int main() { int a = 4, n, i, result = 0; scanf("%d", &n); for (i = 0;i < n; i++) result += a; }
Q5
What will be the output of the following C code? #include <stdio.h> int main() { int a[5] = {1, 2, 3, 4, 5}; int i; for (i = 0; i < 5; i++) if ((char)a[i] == '5') printf("%d\n", a[i]); else printf("FAIL\n"); }
Q6
What will be the output of the following C code? #include <stdio.h> int main() { j = 10; printf("%d\n", j++); return 0; }
Q7
What will be the output of the following C code? #include <stdio.h> void main() { float x = 0.1; if (x == 0.1) printf("India"); else printf("Advanced C Classes"); }
Q8
What will be the final value of j in the following C code? #include <stdio.h> int main() { int i = 0, j = 0; if (i && (j = i + 10)) //do something ; }
Q9
What will be the output of the following C code? #include <stdio.h> void main() { int a = 5 * 3 % 6 - 8 + 3; printf("%d", a); }
Q10
What will be the output of the following C code? #include <stdio.h> int main() { int x = 1, y = 0; x &&= y; printf("%d\n", x); }
Q11
What will be the output of the following C code? #include <stdio.h> int main() { int i = 2; int j = ++i + i; printf("%d\n", j); }
Q12
Will the following C code compile without any error? #include <stdio.h> int main() { int k; { int k; for (k = 0; k < 10; k++); } }
Q13
What will be the output of the following C code? #include <stdio.h> int main() { unsigned int a = 10; a = ~a; printf("%d\n", a); }
Q14
What will be the final value of j in the following C code? #include <stdio.h> int main() { int i = 10, j = 0; if (i || (j = i + 10)) //do something ; }
Q15
What will be the output of the following C code? #include <stdio.h> int main() { int a = 1, b = 1, d = 1; printf("%d, %d, %d", ++a + ++a+a++, a++ + ++b, ++d + d++ + a++); }
Q16
What will be the output of the following C code? #include <stdio.h> int main() { int x = 2, y = 0; int z; z = (y++, y); printf("%d\n", z); return 0; }
Q17
What will be the output of the following C code? #include <stdio.h> #define MAX 2 enum bird {SPARROW = MAX + 1, PARROT = SPARROW + MAX}; int main() { enum bird b = PARROT; printf("%d\n", b); return 0; }
Q18
What is the size of an int data type?
Q19
Pick the incorrect statement with respect to enums.
Q20
What will be the output of the following C code? #include<stdio.h> enum shyam { a=2,b=3.56 }; enum shyam s; main() { printf("%d%d",a,b); }
Q21
What will be the output of the following C function? #include <stdio.h> enum birds {SPARROW, PEACOCK, PARROT}; enum animals {TIGER = 8, LION, RABBIT, ZEBRA}; int main() { enum birds m = TIGER; int k; k = m; printf("%d\n", k); return 0; }
Q22
What will be the output of the following C code? #include <stdio.h> int main() { int x = 0, y = 2; int z = ~x & y; printf("%d\n", z); }
Q23
What will be the final values of a and c in the following C statement? (Initial values: a = 2, c = 1) c = (c) ? a = 0 : 2;
Q24
What will be the output of the following C code? #include <stdio.h> void main() { int k = 8; int m = 7; int z = k < m ? k++ : m++; printf("%d", z); }
Q25
What will be the output of the following C code? #include <stdio.h> int main() { int a = 1, b = 2; a += b -= a; printf("%d %d", a, b); }