Question 1 of 25
Hints left: 3
Q1
What will be the output of the following C code snippet? #include <stdio.h> void main() { 1 < 2 ? return 1: return 2; }
Q2
Which of the following is not a valid C variable name?
Q3
What will be the final values of i and j in the following C code? #include <stdio.h> int x = 0; int f() { if (x == 0) return x + 1; else return x - 1; } int g() { return x++; } int main() { int i = (f() + g()) | g(); //bitwise or int j = g() | (f() + g()); //bitwise or }
Q4
What will be the output of the following C code? #include <stdio.h> void main() { int k = 8; int m = 7; int z = k < m ? k = m : m++; printf("%d", z); }
Q5
What will be the output of the following C code? #include <stdio.h> void main() { int b = 6; int c = 7; int a = ++b + c--; printf("%d", a); }
Q6
What will be the output of the following C code if input given is 2? #include<stdio.h> enum day { a,b,c=5,d,e }; main() { printf("Enter the value for a"); scanf("%d",a); printf("%d",a); }
Q7
Which type of conversion is NOT accepted?
Q8
What will be the output of the following C code? #include <stdio.h> void main() { int b = 5 & 4 & 6; printf("%d", b); }
Q9
What is the precedence of arithmetic operators (from highest to lowest)?
-
A
-
B
-
C
-
D
Q10
What will be the output of the following C code? #include <stdio.h> int main() { int a = 10; double b = 5.6; int c; c = a + b; printf("%d", c); }
Q11
The format identifier '%i' is also used for . . . . . . . . data type.
Q12
What will be the output of the following C code? #include <stdio.h> int main() { int x = 1, y = 2; int z = x & y == 2; printf("%d\n", z); }
Q13
enum types are processed by . . . . . . . .
Q14
What will be the output of the following C code? #include <stdio.h> void main() { int a = 2 + 4 + 3 * 5 / 3 - 5; printf("%d", a); }
Q15
When do you need to use type-conversions?
Q16
What will be the output of the following C code? #include <stdio.h> int main() { int x = 3, y = 2; int z = x << 1 > 5; printf("%d\n", z); }
Q17
What will be the output of the following C code? #include <stdio.h> int main() { int x = 3, y = 2; int z = x /= y %= 2; printf("%d\n", z); }
Q18
What will be the output of the following C code? #include <stdio.h> int main() { int a = 10; if (a == a--) printf("TRUE 1\t"); a = 10; if (a == --a) printf("TRUE 2\t"); }
Q19
A variable declared in a function can be used in main().
Q20
What will be the output of the following C code? #include <stdio.h> void main() { double b = 5 & 3 && 4 || 5 | 6; printf("%lf", b); }
Q21
What will be the output of the following C code? #include <stdio.h> void main() { int x = 97; int y = sizeof(x++); printf("X is %d", x); }
Q22
What will be the output of the following C code considering the size of a short int is 2, char is 1 and int is 4 bytes? #include <stdio.h> int main() { short int i = 20; char c = 97; printf("%d, %d, %d\n", sizeof(i), sizeof(c), sizeof(c + i)); return 0; }
Q23
A user defined data type, which is used to assign names to integral constants is called . . . . . . . .
Q24
What is the result of logical or relational expression in C?
Q25
What will be the output of the following C code? #include <stdio.h> int main() { int x = 2, y = 0; int z = (y++) ? y == 1 && x : 0; printf("%d\n", z); return 0; }