What is the output of this C code? 1. #include
2. int main()
3. {
4. int i = 0;
5. int j = i++ + i;
6. printf("%d\n", j);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 10, b = 5, c = 3;
5. b != !a;
6. c = !!a;
7. printf("%d\t%d", b, c);
8. }
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. int main()
3. {
4. int y = 1;
5. if (y & (y = 2))
6. printf("true %d\n", y);
7. else
8. printf("false %d\n", y);
9. }
Which of the following is not a pointer declaration?
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. }
Are logical operators sequence points?
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 10, b = 10;
5. if (a = 5)
6. b--;
7. printf("%d, %d", a, b--);
8. }
for c = 2, value of c after c <<= 1;
When do you need to use type-conversions?
Comment on the output of this C code? 1. #include
2. int main()
3. {
4. int ThisIsVariableName = 12;
5. int ThisIsVariablename = 14;
6. printf("%d", ThisIsVariablename);
7. return 0;
8. }
Which is valid C expression?
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. }
What is the value of x in this C code? 1. #include
2. void main()
3. {
4. int x = 5 * 9 / 3 + 9;
5. }
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 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. }
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. }
Comment on the following expression? c = (n) ? a : b; can be rewritten as
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. }
Function tolower(c) defined in library works for
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. }
The format identifier ‘%i’ is also used for _____ data type?
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. int main()
3. {
4. const int p;
5. p = 4;
6. printf("p is %d", p);
7. return 0;
8. }
Which of the following is not a valid variable name declaration?
When do you need to use type-conversions?
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. #define a 10
3. int main()
4. {
5. const int a = 5;
6. printf("a = %d\n", a);
7. }
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 output of this C code? 1. #include
2. int main()
3. {
4. int a = 4, n, i, result = 0;
5. scanf("%d", n);
6. for (i = 0;i < n; i++)
7. result += a;
8. }
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. }
Comment on the output of this C code? 1. #include
2. void main()
3. {
4. int k = 4;
5. int *const p = &k;
6. int r = 3;
7. p = &r;
8. printf("%d", p);
9. }
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 type conversion is NOT accepted?
Which expression has to be present in the following? exp1 ? exp2 : exp3;
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. void main()
3. {
4. int a = 5 * 3 % 6 - 8 + 3;
5. printf("%d", a);
6. }
What is the size of an int data type?
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = -2;
5. if (!0 == 1)
6. printf("yes\n");
7. else
8. printf("no\n");
9. }
Function tolower(c) defined in library works for