What is the problem in following variable declaration? float 3Bedroom-Hall-Kitchen?;
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 1;
5. short int i = 2;
6. float f = 3;
7. if (sizeof((x == 2) ? f : i) == sizeof(float))
8. printf("float\n");
9. else if (sizeof((x == 2) ? f : i) == sizeof(short int))
10. printf("short int\n");
11. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. printf("sanfoundry\rclass\n");
5. return 0;
6. }
Which of the following is not an arithmetic operation?
What is the output of this C code? 1. #include
2. int main()
3. {
4. j = 10;
5. printf("%d\n", j++);
6. return 0;
7. }
C99 standard guarantess uniqueness of _____ characters for external names.
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. }
Function tolower(c) defined in library works for
The code snippet below produces 1. #include
2. void main()
3. {
4. 1 < 2 ? return 1 : return 2;
5. }
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 x = 2, y = 0;
5. int z = (y++) ? 2 : y == 1 && x;
6. printf("%d\n", z);
7. return 0;
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(); //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 = 2, y = 2;
5. x /= x / y;
6. printf("%d\n", x);
7. return 0;
8. }
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 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. }
Relational operators cannot be used on:
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 x = 5.3 % 2;
5. printf("Value of x is %d", x);
6. }
What will be the data type of the expression (a < 50) ? var1 : var2; provided a = int, var1 = double, var2 = float
Which expression has to be present in the following? exp1 ? exp2 : exp3;
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 output of this C code? 1. #include
2. void main()
3. {
4. unsigned int x = -5;
5. printf("%d", x);
6. }
Which of the following declaration is not supported by C?
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. }
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. }
The precedence of arithmetic operators is (from highest to lowest)
-
-
-
-
Comment on the following expression? c = (n) ? a : b; can be rewritten as
What is short int in C programming?
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 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. 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. printf("Hello World! %d \n", x);
5. return 0;
6. }
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. 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. float x = 0.1;
5. if (x == 0.1)
6. printf("Sanfoundry");
7. else
8. printf("Advanced C Classes");
9. }
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. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 2;
5. if (a >> 1)
6. printf("%d\n", a);
7. }
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. }
For the following code snippet: char *str = “Sanfoundry.com\0” “training classes”; The character pointer str holds reference to string: