What is the output of this C code? 1. #include
2. void main()
3. {
4. int y = 3;
5. int x = 5 % 2 * 3 / 2;
6. printf("Value of x is %d", x);
7. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 0;
5. if (x = 0)
6. printf("Its zero\n");
7. else
8. printf("Its not zero\n");
9. }
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 output of this C code? 1. #include
2. void main()
3. {
4. int x = 1, y = 0, z = 5;
5. int a = x && y || z++;
6. printf("%d", z);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 2, y = 0;
5. int z = (y++) ? y == 1 && x : 0;
6. printf("%d\n", z);
7. return 0;
8. }
What is the output of this C code? 1, #include
2. int main()
3. {
4. int c = 2 ^ 3;
5. printf("%d\n", c);
6. }
In expression i = g() + f(), first function called depends on
What is the output of this C code (on a 32-bit machine)? 1. #include
2. int main()
3. {
4. int x = 10000;
5. double y = 56;
6. int *p = &x;
7. double *q = &y;
8. printf("p and q are %d and %d", sizeof(p), sizeof(q));
9. return 0;
10. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int i = 1;
5. if (i++ && (i == 1))
6. printf("Yes\n");
7. else
8. printf("No\n");
9. }
What is the output of this C code? 1. #include
2. void reverse(int i);
3. int main()
4. {
5. reverse(1);
6. }
7. void reverse(int i)
8. {
9. if (i > 5)
10. return ;
11. printf("%d ", i);
12. return reverse((i++, i));
13. }
Comment on the output of this C code? 1. #include
2. void main()
3. {
4. int k = 8;
5. int m = 7;
6. int z = k < m ? k = m : m++;
7. printf("%d", z);
8. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. float x = 'a';
5. printf("%f", x);
6. return 0;
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 2;
5. x = x << 1;
6. printf("%d\n", x);
7. }
What is the final value of j in the below code? 1. #include
2. int main()
3. {
4. int i = 10, j = 0;
5. if (i || (j = i + 10))
6. //do something
7. ;
8. }
What is the problem in following variable declaration? float 3Bedroom-Hall-Kitchen?;
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 1, z = 3;
5. int y = x << 3;
6. printf(" %d\n", y);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 2, y = 2;
5. x /= x / y;
6. printf("%d\n", x);
7. return 0;
8. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int i = -3;
5. int k = i % 2;
6. printf("%d\n", k);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 2, y = 2;
5. int z = x ^ y & 1;
6. printf("%d\n", z);
7. }
Comment on the output of this C code? 1. #include
2. int main()
3. {
4. int i = 2;
5. int i = i++ + i;
6. printf("%d\n", i);
7. }
Which is correct with respect to size of the datatypes?
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 4, y, z;
5. y = --x;
6. z = x--;
7. printf("%d%d%d", x, y, z);
8. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. const int p;
5. p = 4;
6. printf("p is %d", p);
7. return 0;
8. }
For which of the following, “PI++;” code will fail?
What is the output of this C code? 1. #include
2. int main()
3. {
4. unsigned int a = 10;
5. a = ~a;
6. printf("%d\n", a);
7. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 4, y, z;
5. y = --x;
6. z = x--;
7. printf("%d%d%d", x, y, z);
8. }
What is the output of the below code considering size of short int is 2, char is 1 and int is 4 bytes? 1. #include
2. int main()
3. {
4. short int i = 20;
5. char c = 97;
6. printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i));
7. return 0;
8. }
What is the output of this C code? 1. #include
2. #define MAX 2
3. enum bird {SPARROW = MAX + 1, PARROT = SPARROW + MAX};
4. int main()
5. {
6. enum bird b = PARROT;
7. printf("%d\n", b);
8. return 0;
9. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 1, b = 2;
5. a += b -= a;
6. printf("%d %d", a, b);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. printf("C programming %s", "Class by\n%s Sanfoundry", "WOW");
5. }
Which of the following cannot be a variable name in C?
Comment on the output of this C code? 1. #include
2. int main()
3. {
4. int i = 2;
5. int i = i++ + i;
6. printf("%d\n", i);
7. }
What will be the data type of the expression (a < 50) ? var1 : var2; provided a = int, var1 = double, var2 = float
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 1, y = 0, z = 3;
5. x > y ? printf("%d", z) : return z;
6. }
For initialization a = 2, c = 1 the value of a and c after this code will be c = (c) ? a = 0 : 2;
What is the output of this C code? 1. #include
2. void main()
3. {
4. double b = 3 % 0 * 1 - 4 / 2;
5. printf("%lf", b);
6. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. 1 < 2 ? return 1: return 2;
5. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int a = 5 * 3 + 2 - 4;
5. printf("%d", a);
6. }