What is the output of this C code? 1. #include
2. void main()
3. {
4. unsigned int x = -5;
5. printf("%d", x);
6. }
What is the final value of j in the below code? 1. #include
2. int main()
3. {
4. int i = 10, j = 0;
5. if (i || (j = i + 10))
6. //do something
7. ;
8. }
Comment on the output of this C code? 1. #include
2. int main()
3. {
4. char c;
5. int i = 0;
6. FILE *file;
7. file = fopen("test.txt", "w+");
8. fprintf(file, "%c", 'a');
9. fprintf(file, "%c", -1);
10. fprintf(file, "%c", 'b');
11. fclose(file);
12. file = fopen("test.txt", "r");
13. while ((c = fgetc(file)) != -1)
14. printf("%c", c);
15. return 0;
16. }
Result of a logical or relational expression in C is
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 i = 2;
5. int j = ++i + i;
6. printf("%d\n", j);
7. }
Which of the following data type will throw an error on modulus operation(%)?
Which of the following declaration is not supported by C?
Does this compile without error? 1. #include
2. int main()
3. {
4. for (int k = 0; k < 10; k++);
5. return 0;
6. }
C99 standard guarantess uniqueness of _____ characters for external names.
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? #include
int main()
{
int x = 1;
int y = x == 1 ? getchar(): 2;
printf("%d\n", y);
}
What is the output of this C code (on a 32-bit machine)? 1. #include
2. int main()
3. {
4. int x = 10000;
5. double y = 56;
6. int *p = &x;
7. double *q = &y;
8. printf("p and q are %d and %d", sizeof(p), sizeof(q));
9. return 0;
10. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 2, y = 0;
5. int z = (y++) ? 2 : y == 1 && x;
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 = 10, b = 10;
5. if (a = 5)
6. b--;
7. printf("%d, %d", a, b--);
8. }
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 = 2, y = 2;
5. int z = x ^ y & 1;
6. printf("%d\n", z);
7. }
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 will be the data type of the expression (a < 50) ? var1 : var2; provided a = int, var1 = double, var2 = float
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. }
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 x = 2, y = 0;
5. int z = x && y = 1;
6. printf("%d\n", z);
7. }
Which data type is most suitable for storing a number 65000 in a 32-bit system?
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. void main()
3. {
4. int a = 3;
5. int b = ++a + a++ + --a;
6. printf("Value of b is %d", b);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 3; //, y = 2;
5. const int *p = &x;
6. *p++;
7. printf("%d\n", *p);
8. }
The precedence of arithmetic operators is (from highest to lowest)
-
-
-
-
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. }
Which of the following is true for variable names in C?
Which of the following is not an arithmetic operation?
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. }
Enum types are processed by
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. }
Relational operators cannot be used on:
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 5.3 % 2;
5. printf("Value of x is %d", x);
6. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int x = 1, z = 3;
5. int y = x << 3;
6. printf(" %d\n", y);
7. }
Variable name resolving (number of significant characters for uniqueness of variable) depends on
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. }