What is the problem in following variable declaration? float 3Bedroom-Hall-Kitchen?;
What is short int in C programming?
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 size of an int data type?
What is the output of this C code? 1. #include
2. int main()
3. {
4. int x = 2, y = 1;
5. x *= x + y;
6. printf("%d\n", x);
7. return 0;
8. }
C99 standard guarantess uniqueness of _____ characters for external names.
What is the output of this C code? 1. #include
2. int main()
3. {
4. int i = 1;
5. if (i++ && (i == 1))
6. printf("Yes\n");
7. else
8. printf("No\n");
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. 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. 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. int main()
3. {
4. int x = 3; //, y = 2;
5. const int *p = &x;
6. *p++;
7. printf("%d\n", *p);
8. }
Which of the following is not a valid C variable name?
What is the output of this C code? 1. #include
2. int main()
3. {
4. int a = 10;
5. if (a == a--)
6. printf("TRUE 1\t");
7. a = 10;
8. if (a == --a)
9. printf("TRUE 2\t");
10. }
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. }
C99 standard guarantees uniqueness of ____ characters for internal names.
Which among the following is NOT a logical or relational operator?
For the following code snippet: char *str = “Sanfoundry.com\0” “training classes”; The character pointer str holds reference to string:
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. int main()
3. {
4. int i = 0;
5. int x = i++, y = ++i;
6. printf("%d % d\n", x, y);
7. return 0;
8. }
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 among the following are the fundamental arithmetic operators, ie, performing the desired operation can be done using that operator only?
-
-
-
-
What is the output of this C code? 1. #include
2. int main()
3. {
4. unsigned int i = 23;
5. signed char c = -23;
6. if (i > c)
7. printf("Yes\n");
8. else if (i < c)
9. printf("No\n");
10. }
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. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. 1 < 2 ? return 1: return 2;
5. }
Which of the datatypes have size that is variable?
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. int x = 1, y = 0;
5. x &&= y;
6. printf("%d\n", x);
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.}
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. }
What is the output of the below code considering size of short int is 2, char is 1 and int is 4 bytes? 1. #include
2. int main()
3. {
4. short int i = 20;
5. char c = 97;
6. printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i));
7. return 0;
8. }
What is the output of this C code? 1. #include
2. void main()
3. {
4. int a = 2 + 4 + 3 * 5 / 3 - 5;
5. printf("%d", a);
6. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. int y = 2;
5. int z = y +(y = 10);
6. printf("%d\n", z);
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. 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. void main(
3. {
4. double b = 8;
5. b++;
6. printf("%lf", b);
7. }
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. 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. void main()
3. {
4. int x = 0, y = 2, z = 3;
5. int a = x & y | z;
6. printf("%d", a);
7. }
Which of the following is not a valid variable name declaration?
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. }