What is the output of this C code? 1. #include
2. int main()
3. {
4. signed char chr;
5. chr = 128;
6. printf("%d\n", chr);
7. return 0;
8. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 1, y = 2;
5. if (x && y == 1)
6. printf("true\n");
7. else
8. printf("false\n");
9. }
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. void main()
3. {
4. char a = 'a';
5. int x = (a % 10)++;
6. printf("%d\n", x);
7. }
Which of the following type-casting have chances for wrap around?
Function tolower(c) defined in library works for
Comment on the output of this C code? 1. #include
2. void main()
3. {
4. float x = 0.1;
5. printf("%d, ", x);
6. printf("%f", x);
7. }
Which type conversion is NOT accepted?
The format identifier ‘%i’ is also used for _____ data type?
What is the output of this C code? 1. #include
2. enum birds {SPARROW, PEACOCK, PARROT};
3. enum animals {TIGER = 8, LION, RABBIT, ZEBRA};
4. int main()
5. {
6. enum birds m = TIGER;
7. int k;
8. k = m;
9. printf("%d\n", k);
1o. return 0;
11. }
When double is converted to float, the value is?
What will happen if the below program is executed? 1. #include
2. int main()
3. {
4. int main = 3;
5. printf("%d", main);
6. return 0;
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 10;
5. if (a == a--)
6. printf("TRUE 1\t");
7. a = 10;
8. if (a == --a)
9. printf("TRUE 2\t");
10. }
What is the output of this C code? 1. #include
2. #define a 10
3. int main()
4. {
5. const int a = 5;
6. printf("a = %d\n", a);
7. }
for c = 2, value of c after c <<= 1;
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. void main()
3. {
4. int a = 5 * 3 % 6 - 8 + 3;
5. printf("%d", a);
6. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 10, b = 5, c = 5;
5. int d;
6. d = a == (b + c);
7. printf("%d", d);
8. }
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. }
What is the output of this C code? 1. #include
2. void main(
3. {
4. double b = 8;
5. b++;
6. printf("%lf", b);
7. }
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. }
Does this compile without error? 1. #include
2. int main()
3. {
4. int k;
5. {
6. int k;
7. for (k = 0; k < 10; k++);
8. }
9. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 97;
5. int y = sizeof(x++);
6. printf("X is %d", x);
7. }
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. }
Which of the following is not a valid variable name declaration?
The output of the code below is 1. #include
2. void main()
3. {
4. int k = 8;
5. int m = 7;
6. k < m ? k = k + 1 : m = m + 1;
7. printf("%d", k);
8. }
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. }
Which of the following is a User-defined data type?
Variable name resolving (number of significant characters for uniqueness of variable) depends on
What will be the data type of the result of the following operation? (float)a * (int)b / (long)c * (double)d
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 1, b = 1, d = 1;
5. printf("%d, %d, %d", ++a + ++a+a++, a++ + ++b, ++d + d++ + a++);
6. }
What is the output of this C code? (7 and 8 are entered) 1. #include
2. void main()
3. {
4. float x;
5. int y;
6. printf("enter two numbers \n", x);
7. scanf("%f %f", &x, &y);
8. printf("%f, %d", x, y);
9. }
What is the value of i and j in the below code? 1. #include
2. int x = 0;
3. int main()
4. {
5. int i = (f() + g()) || g();
6. int j = g() || (f() + g());
7. }
8. int f()
9. {
10. if (x == 0)
11. return x + 1;
12. else
13. return x - 1;
14. }
15. int g()
16. {
17. return x++;
18. }
What is the final value of j in the below code? 1. #include
2. int main()
3. {
4. int i = 0, j = 0;
5. if (i && (j = i + 10))
6. //do something
7. ;
8. }
Comment on the output of this C code? 1. #include
2. void main()
3. {
4. int const k = 5;
5. k++;
6. printf("k is %d", k);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 3, y = 2;
5. int z = x << 1 > 5;
6. printf("%d\n", z);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. printf("sanfoundry\rclass\n");
5. return 0;
6. }
Enum types are processed by
What is the size of an int data type?