Variable names beginning with underscore is not encouraged. Why?
What will be the data type of the result of the following operation? (float)a * (int)b / (long)c * (double)d
Does logical operators in C language are evaluated with short circuit?
What is the output of this C code? 1. #include
2. int main()
3. {
4. int i = 2;
5. int j = ++i + i;
6. printf("%d\n", j);
7. }
C99 standard guarantess uniqueness of _____ characters for external names.
What is the output of this C code? 1. #include
2. void main()
3. {
4. int a = -5;
5. int k = (a++, ++a);
6. printf("%d\n", k);
7. }
When do you need to use type-conversions?
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. }
Which among the following are the fundamental arithmetic operators, ie, performing the desired operation can be done using that operator only?
-
-
-
-
When double is converted to float, the value is?
Which of the following cannot be a variable name in C?
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 = 0, y = 2;
5. int z = ~x & y;
6. printf("%d\n", z);
7.}
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. }
Comment on the output of this C code? 1. #include
2. int main()
3. {
4. float f1 = 0.1;
5. if (f1 == 0.1f)
6. printf("equal\n");
7. else
8. printf("not equal\n");
9. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int y = 0;
5. if (1 |(y = 1))
6. printf("y is %d\n", y);
7. else
8. printf("%d\n", y);
9. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int k = 8;
5. int x = 0 == 1 && k++;
6. printf("%d%d\n", x, k);
7. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int b = 6;
5. int c = 7;
6. int a = ++b + c--;
7. printf("%d", a);
8. }
What is the value of the below assignment expression (x = foo())!= 1 considering foo() returns 2
Which of the following is an invalid assignment operator?
Which of the following is not a pointer declaration?
Which of the following format identifier can never be used for the variable var? 1. #include
2. int main()
3. {
4. char *var = "Advanced Training in C by Sanfoundry.com";
5. }
What is the value of x in this C code? 1. #include
2. void main()
3. {
4. int x = 5 * 9 / 3 + 9;
5. }
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 a = 5, b = -7, c = 0, d;
5. d = ++a && ++b || ++c;
6. printf("\n%d%d%d%d", a, b, c, d);
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. }
In expression i = g() + f(), first function called depends on
What is the output of this C code? #include
int main()
{
int x = 1;
int y = x == 1 ? getchar(): 2;
printf("%d\n", y);
}
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. }
Function tolower(c) defined in library works for
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. int main()
3. {
4. int a = 10;
5. double b = 5.6;
6. int c;
7. c = a + b;
8. printf("%d", c);
9. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. if (7 & 8)
5. printf("Honesty");
6. if ((~7 & 0x000f) == 8)
7. printf("is the best policy\n");
8. }
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. }
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. }
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.}
Comment on the output of this C code? 1. #include
2. int main()
3. {
4. const int i = 10;
5. int *ptr = &i;
6. *ptr = 20;
7. printf("%d\n", i);
8. return 0;
9. }
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. }
Which of the following is true for variable names in C?