Choose a topic to test your knowledge and improve your C/C skills
What is the output of this C code? int main() { int i = -5; int k = i %4; printf("%d ", k); }
What is the output of this C code? int main() { int i = 5; int l = i / -4; int k = i % -4; printf("%d %d ", l, k); return 0; }
What is the output of this C code? int main() { int i = 7; i = i / 4; printf("%d ", i); return 0; }
What is the value of x in this C code? void main() { int x = 4 *5 / 2 + 9; }
What is the output of this C code? void main() { int x = 4.3 % 2; printf("Value of x is %d", x); }
What is the output of this C code? void main() { int y = 3; int x = 7 % 4 * 3 / 2; printf("Value of x is %d", x); }
What is the output of this C code? void main() { int a = 5; int b = ++a + a++ + --a; printf("Value of b is %d", b); }
The precedence of arithmetic operators is (from highest to lowest)?
Which of the following is not an arithmetic operation?
Which of the following data type will throw an error on modulus operation(%)?
What is the output of this C code? int main() { int a = 20; double b = 15.6; int c; c = a + b; printf("%d", c); }
What is the output of this C code? int main() { int a = 20, b = 15, c = 5; int d; d = a == (b + c); printf("%d", d); } A. 1
What is the output of this C code? void main() { int x = 0; if (x = 0) printf("Its zero "); else printf("Its not zero "); }
What is the output of this C code? void main() { int k = 8; int x = 0 == 1 && k++; printf("%d%d ", x, k); }
What is the output of this C code? void main() { char a = 'a'; int x = (a % 10)++; printf("%d ", x); }
What is the output of this C code? void main() { 1 < 2 ? return 1: return 2; }
What is the output of this C code? void main() { unsigned int x = -5; printf("%d", x); }
What is the output of this C code? void main() { unsigned int x = -5; printf("%d", x); }
What is the output of this C code? int main() { int x = 2, y = 1; x *= x + y; printf("%d ", x); return 0; }
What is the output of this C code? int main() { int x = 2, y = 2; x /= x / y; printf("%d ", x); return 0; }
What is the type of the below assignment expression if x is of type float, y is of type int? y = x + y;
What is the value of the below assignment expression (x = foo())!= 1 considering foo() returns 2
Operation "a = a * b + a can also be written as:
for c = 2, value of c after c <<= 1;
What is the output of this C code? int main() { int a = 1, b = 2; a += b -= a; printf("%d %d", a, b); }
What is the output of this C code? int main() { int a = 4, n, i, result = 0; scanf("%d", n); for (i = 0;i < n; i++) result += a; }
Which of the following is an invalid assignment operator?
What is the output of this C code? int main() { int c = 2 ^ 3; printf("%d ", c); }
What is the output of this C code? int main() { unsigned int a = 10; a = ~a; printf("%d ", a); }
What is the output of this C code? int main() { if (7 & 8) printf("Honesty"); if ((~7 & 0x000f) == 8) printf("is the best policy "); }
What is the output of this C code? int main() { int a = 2; if (a >> 1) printf("%d ", a); }
What is the output of this C code? int main() { int a = 2; if (a >> 1) printf("%d ", a); }
Comment on the output of this C code? int main() { int i, n, a = 4; scanf("%d", &n); for (i = 0; i < n; i++) a = a * 2; }
What is the output of this C code? void main() { int x = 97; int y = sizeof(x++); printf("x is %d", x); }
What is the output of this C code? void main() { int x = 4, y, z; y = --x; z = x--; printf("%d%d%d", x, y, z); }
What is the output of this C code? void main() { int x = 4; int *p = &x; int *k = p++; int r = p - k; printf("%d", r); }
What is the output of this C code? void main() { int a = 5, b = -7, c = 0, d; d = ++a && ++b || ++c; printf(" %d%d%d%d", a, b, c, d); }
What is the output of this C code? void main() { int a = -5; int k = (a++, ++a); printf("%d ", k); }
What is the output of this C code? int main() { int x = 2; x = x << 1; printf("%d ", x);
What is the output of this C code? int main() { int x = -2; x = x >> 1; printf("%d ", x); }
What is the output of this C code? int main() { if (~0 == 1) printf("yes "); else printf("no "); }
What is the output of this C code? int main() { int x = -2; if (!0 == 1) printf("yes "); else printf("no "); }
What is the output of this C code? int main() { int y = 0; if (1 |(y = 1)) printf("y is %d ", y); else printf("%d ", y); }
What is the output of this C code? int main() { int y = 1; if (y & (y = 2)) printf("true %d "); else printf("false %d "); }
What is the difference between the following 2 codes? //Program 1 int main() { int d, a = 1, b = 2; d = a++ + ++b; printf("%d %d %d", d, a, b); } //Program 2 int main() { int d, a = 1, b = 2; d = a++ + ++b; printf("%d %d %d", d, a, b); }
What is the output of this C code? int main() { int a = 1, b = 1, c; c = a++ + b; printf("%d, %d", a, b); }
What is the output of this C code? int main() { int a = 1, b = 1, d = 1; printf("%d, %d, %d", ++a + ++a+a++, a++ + ++b, ++d + d++ + a++); }
For which of the following, "PI++; code will fail?
What is the output of this C code? int main() { int a = 10, b = 10; if (a = 5) b--; printf("%d, %d", a, b--); }
What is the output of this C code? int main() { int i = 0; int j = i++ + i; printf("%d ", j); }
What is the output of this C code? int main() { int i = 2; int j = ++i + i; printf("%d ", j); }
Comment on the output of this C code? int main() { int i = 2; int i = i++ + i; printf("%d ", i); }
What is the output of this C code? int main() { int i = 0; int x = i++, y = ++i; printf("%d % d ", x, y); return 0; }
What is the output of this C code? int main() { int i = 10; int *p = &i; printf("%d ", *p++); }
What is the output of this C code? void main() { int x = 97; int y = sizeof(x++); printf("X is %d", x); }
What is the output of this C code? void main() { int x = 4, y, z; y = --x; z = x--; printf("%d%d%d", x, y, z); }
What is the output of this C code? void main() { int x = 4; int *p = &x; int *k = p++; int r = p - k; printf("%d", r); }
What is the output of this C code? void main() { int a = 5, b = -7, c = 0, d; d = ++a && ++b || ++c; printf(" %d%d%d%d", a, b, c, d); }
What is the output of this C code? void main() { int a = -5; int k = (a++, ++a); printf("%d ", k); } A. -4B. -5C. 4D. -3
What is the output of this C code? void main() { int x = 1, y = 0, z = 5; int a = x && y || z++; printf("%d", z); }
What is the output of this C code? void main() { int x = 1, y = 0, z = 5; int a = x && y && z++; printf("%d", z); }
What is the output of this C code? int main() { int x = 1, y = 0, z = 3; x > y ? printf("%d", z) : return z; }
What is the output of this C code? void main() { int x = 1, z = 3; int y = x << 3; printf(" %d ", y); }
What is the output of this C code? void main() { int x = 0, y = 2, z = 3; int a = x & y | z; printf("%d", a); }
What is the final value of j in the below code? int main() { int i = 0, j = 0; if (i && (j = i + 10)) //do something ; }
What is the output of this C code? int main() { int i = 1; if (i++ && (i == 1)) printf("Yes "); else printf("No "); }
Are logical operators sequence points?
Does logical operators in C language are evaluated with short circuit?
Result of a logical or relational expression in C is?
What will be the value of d in the following program? int main() { int a = 10, b = 5, c = 5; int d; d = b + c == a; printf("%d", d); } A
What is the output of this C code? int main() { int a = 10, b = 5, c = 3; b != !a; c = !!a; printf("%d %d", b, c); }
Which among the following is NOT a logical or relational operator? A. !=B. ==C. ||D. = Which among the following is NOT a logical or relational operator?
What is the output of this C code? int main() { int a = 10; if (a == a--) printf("TRUE 1 "); a = 10; if (a == --a) printf("TRUE 2 "); }
Relational operators cannot be used on: