Question 1 of 25
Hints left: 3
Q1
Which of the following is the correct order of evaluation for the given expression? a = w % x / y * z;
Q2
What will be the output of the following C code? #include <stdio.h> void main() { int a = 3; int b = ++a + a++ + --a; printf("Value of b is %d", b); }
Q3
What will be the output of the following C code? #include <stdio.h> int main() { char c; int i = 0; FILE *file; file = fopen("test.txt", "w+"); fprintf(file, "%c", 'a'); fprintf(file, "%c", -1); fprintf(file, "%c", 'b'); fclose(file); file = fopen("test.txt", "r"); while ((c = fgetc(file)) != -1) printf("%c", c); return 0; }
Q4
What will be the output of the following C code? #include <stdio.h> int main() { int i = 0; int x = i++, y = ++i; printf("%d % d\n", x, y); return 0; }
Q5
What will be the output of the following C code? #include <stdio.h> void main() { int k = 0; double b = k++ + ++k + k--; printf("%d", k); }
Q6
What will be the output of the following C code? #include <stdio.h> void main() { int x = 1, z = 3; int y = x << 3; printf(" %d\n", y); }
Q7
What is the problem in the following variable declaration? float 3Bedroom-Hall-Kitchen?;
Q8
What will be the output of the following C code? #include <stdio.h> void main() { int a = 5, b = -7, c = 0, d; d = ++a && ++b || ++c; printf("\n%d%d%d%d", a, b, c, d); }
Q9
Which of the following operators has an associativity from Right to Left?
Q10
Which of the following declaration is not supported by C?
Q11
What will be the output of the following C code? #include <stdio.h> void foo(const int *); int main() { const int i = 10; printf("%d ", i); foo(&i); printf("%d", i); } void foo(const int *i) { *i = 20; }
Q12
Which is valid C expression?
Q13
What will be the output of the following C code? #include <stdio.h> void main() { int k = 8; int m = 7; k < m ? k = k + 1 : m = m + 1; printf("%d", k); }
Q14
What will be the output of the following C code? #include <stdio.h> int main() { printf("Ram\rShyam\n"); return 0; }
Q15
Which of the following is not a valid variable name declaration?
Q16
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); }
Q17
C99 standard guarantees uniqueness of . . . . . . . . characters for internal names.
Q18
What will be the output of the following C code? #include <stdio.h> int main() { int x = 2, y = 2; x /= x / y; printf("%d\n", x); return 0; }
Q19
What will be the output of the following C code? #include<stdio.h> int main() { int a = 1, b = 2, c = 3, d = 4, e; e = c + d = b * a; printf("%d, %d\n", e, d); }
Q20
What will be the output of the following C code? #include <stdio.h> void main() { double b = 3 % 0 * 1 - 4 / 2; printf("%lf", b); }
Q21
Which of the following format identifier can never be used for the variable var? #include <stdio.h> int main() { char *var = "The quick brown fox jumps over the lazy dog"; }
Q22
While swapping 2 numbers what precautions to be taken care? b = (b / a); a = a * b; b = a / b;
Q23
What will be the output of the following C code? #include <stdio.h> #include <string.h> int main() { char *str = "x"; char c = 'x'; char ary[1]; ary[0] = c; printf("%d %d", strlen(str), strlen(ary)); return 0; }
Q24
What will be the output of the following C code? #include <stdio.h> int main() { int x = 3, i = 0; do { x = x++; i++; } while (i != 3); printf("%d\n", x); }
Q25
Comment on the following statement. n = 1; printf("%d, %dn", 3*n, n++);