What will be the data type of the expression (a < 50) ? var1 : var2; provided a = int, var1 = double, var2 = float
Variable name resolving (number of significant characters for uniqueness of variable) depends on
Which of the datatypes have size that is variable?
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 type of the below assignment expression if x is of type float, y is of type int? y = x + y;
What is the output of this C code? 1. #include
2. enum birds {SPARROW, PEACOCK, PARROT};
3. enum animals {TIGER = 8, LION, RABBIT, ZEBRA};
4. int main()
5. {
6. enum birds m = TIGER;
7. int k;
8. k = m;
9. printf("%d\n", k);
1o. return 0;
11. }
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. 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 i = 10;
5. int *p = &i;
6. printf("%d\n", *p++);
7. }
Which keyword is used to prevent any changes in the variable within a C program?
Which among the following is NOT a logical or relational operator?
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. unsigned int a = 10;
5. a = ~a;
6. printf("%d\n", a);
7. }
What is the output of this C code? 1. #include
2. int main()
3. {
4. float x = 'a';
5. printf("%f", x);
6. return 0;
7. }
Operation “a = a * b + a” can also be written as:
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 x = 4;
5. int *p = &x;
6. int *k = p++;
7. int r = p - k;
8. printf("%d", r);
9. }
When do you need to use type-conversions?
What is the output of this C code? 1. #include
2. #define MAX 2
3. enum bird {SPARROW = MAX + 1, PARROT = SPARROW + MAX};
4. int main()
5. {
6. enum bird b = PARROT;
7. printf("%d\n", b);
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. void main()
3. {
4. char a = 'a';
5. int x = (a % 10)++;
6. printf("%d\n", x);
7. }
What is the value of the below assignment expression (x = foo())!= 1 considering foo() returns 2
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 output of this C code? 1. #include
2. void main()
3. {
4. int a = 5, b = -7, c = 0, d;
5. d = ++a && ++b || ++c;
6. printf("\n%d%d%d%d", a, b, c, d);
7. }
What is the problem in following variable declaration? float 3Bedroom-Hall-Kitchen?;
What will happen if the below program is executed? 1. #include
2. int main()
3. {
4. int main = 3;
5. printf("%d", main);
6. return 0;
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. }
Does this compile without error? 1. #include
2. int main()
3. {
4. for (int k = 0; k < 10; k++);
5. return 0;
6. }
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. }
Which of the following is true for variable names in 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. }
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 i = 2;
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;
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. void main()
3. {
4. int a = -5;
5. int k = (a++, ++a);
6. printf("%d\n", k);
7. }
Which of the following cannot be a variable name in C?
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. 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. 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 y = 10000;
5. int y = 34;
6. printf("Hello World! %d\n", y);
7. return 0;
8. }