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. }
C99 standard guarantees uniqueness of ____ characters for internal names.
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 1, y = 2;
5. int z = x & y == 2;
6. printf("%d\n", z);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 2, y = 2;
5. float f = y + x /= x / y;
6. printf("%d %f\n", x, f);
7. return 0;
8. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int y = 2;
5. int z = y +(y = 10);
6. printf("%d\n", z);
7. }
Which among the following are the fundamental arithmetic operators, ie, performing the desired operation can be done using that operator only?
-
-
-
-
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. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 0, y = 2, z = 3;
5. int a = x & y | z;
6. printf("%d", a);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 2;
5. int b = 0;
6. int y = (b == 0) ? a :(a > b) ? (b = 1): a;
7. printf("%d\n", y);
8. }
Which is valid C expression?
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 |= 10);
6. printf("%d\n", z);
7. return 0;
8. }
Does logical operators in C language are evaluated with short circuit?
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++ : m = k;
7. printf("%d", k);
8. }
What is the output of this C code? 1. #include
2. #include
3. int main()
4. {
5. char *str = "x";
6. char c = 'x';
7. char ary[1];
8. ary[0] = c;
9. printf("%d %d", strlen(str), strlen(ary));
10. return 0;
11. }
What is the problem in following variable declaration? float 3Bedroom-Hall-Kitchen?;
Does this compile without error? 1. #include
2. int main()
3. {
4. for (int k = 0; k < 10; k++);
5. return 0;
6. }
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(); //bitwise or
6. int j = g() | (f() + g()); //bitwise or
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 output of this C code? 1. #include
2. int main()
3. {
4. int x = 3, y = 2;
5. int z = x /= y %= 2;
6. printf("%d\n", z);
7. }
Which of the following declaration is not supported by C?
Which of the following is not a valid variable name declaration?
Which of the datatypes have size that is variable?
Which type conversion is NOT accepted?
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 97;
5. char y = x;
6. printf("%c\n", y);
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. }
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 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 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 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. }
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. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int i = -5;
5. i = i / 3;
6. printf("%d\n", i);
7. return 0;
8. }
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? 1. #include
2. int main()
3. {
4. int i = 0;
5. int x = i++, y = ++i;
6. printf("%d % d\n", x, y);
7. return 0;
8. }
Which is correct with respect to size of the datatypes?
Comment on the output of this C code? 1. #include
2. int const print()
3. {
4. printf("Sanfoundry.com");
5. return 0;
6. }
7. void main()
8. {
9. print();
10. }
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. }
What is the output of the code given below 1. #include
2. int main()
3. {
4. int x = 0, y = 2;
5. if (!x && y)
6. printf("true\n");
7. else
8. printf("false\n");
9. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int a = 3;
5. int b = ++a + a++ + --a;
6. printf("Value of b is %d", b);
7. }