Which of the following declaration is not supported by C?
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. }
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 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 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. 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 = 97;
5. int y = sizeof(x++);
6. printf("x is %d", x);
7. }
Which type conversion is NOT accepted?
What will be the value of d in the following program? 1. #include
2. int main()
3. {
4. int a = 10, b = 5, c = 5;
5. int d;
6. d = b + c == a;
7. printf("%d", d);
8. }
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. void foo(const int *);
3. int main()
4. {
5. const int i = 10;
6. printf("%d ", i);
7. foo(&i);
8. printf("%d", i);
9. }
10. void foo(const int *i)
11. {
12. *i = 20;
13. }
Which of the following is not a valid variable name declaration?
Which of the following cannot be a variable name in C?
Operation “a = a * b + a” can also be written as:
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 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. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. enum {ORANGE = 5, MANGO, BANANA = 4, PEACH};
5. printf("PEACH = %d\n", PEACH);
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. }
Which of the following is an invalid assignment operator?
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 4;
5. int *p = &x;
6. int *k = p++;
7. int r = p - k;
8. printf("%d", r);
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. }
The name of the variable used in one function cannot be used in another function
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. }
Comment on the output of this C code? 1. #include
2. int main()
3. {
4. int i, n, a = 4;
5. scanf("%d", &n);
6. for (i = 0; i < n; i++)
7. a = a * 2;
8. }
Variable name resolving (number of significant characters for uniqueness of variable) depends on
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 2, y = 0, l;
5. int z;
6. z = y = 1, l = x && y;
7. printf("%d\n", l);
8. return 0;
9. }
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 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. }
Which data type is most suitable for storing a number 65000 in a 32-bit system?
What is the value of x in this C code? 1. #include
2. void main()
3. {
4. int x = 5 * 9 / 3 + 9;
5. }
Which of the following is not a valid C variable name?
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. 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 y = 1;
5. if (y & (y = 2))
6. printf("true %d\n", y);
7. else
8. printf("false %d\n", y);
9. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. reverse(1);
5. }
6. void reverse(int i)
7. {
8. if (i > 5)
9. exit(0);
10. printf("%d\n", i);
11. return reverse(i++);
12. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 2, y = 0;
5. int z = x && y = 1;
6. printf("%d\n", z);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 1, b = 1, c;
5. c = a++ + b;
6. printf("%d, %d", a, b);
7. }