Question 1 of 25
Hints left: 3
Q1
The name of the variable used in one function cannot be used in another function.
Q2
What will be the output of the following C code? #include <stdio.h> int main() { int i = 3; int l = i / -2; int k = i % -2; printf("%d %d\n", l, k); return 0; }
Q3
Which of the following type-casting have chances for wrap around?
Q4
What will be the output of the following C code? #include <stdio.h> void main() { int y = 3; int x = 5 % 2 * 3 / 2; printf("Value of x is %d", x); }
Q5
What will be the output of the following C code? #include <stdio.h> int main() { if (~0 == 1) printf("yes\n"); else printf("no\n"); }
Q6
What will be the output of the following C code? #include<stdio.h> enum hi{a,b,c}; enum hello{c,d,e}; main() { enum hi h; h=b; printf("%d",h); return 0; }
Q7
What will be the output of the following C code? #include <stdio.h> int main() { int y = 1, x = 0; int l = (y++, x++) ? y : x; printf("%d\n", l); }
Q8
What will be the output of the following C code? #include <stdio.h> int main() { int x = 2, y = 0; int z = y && (y |= 10); printf("%d\n", z); return 0; }
Q9
Do logical operators in the C language are evaluated with the short circuit?
Q10
What will be the output of the following C code? #include <stdio.h> int main() { int x = 0, y = 2; if (!x && y) printf("true\n"); else printf("false\n"); }
Q11
What will be the output of the following C code? #include<stdio.h> enum Shyam { a,b,c=5 }; int main() { enum Shyam s; b=10; printf("%d",b); }
Q12
Which of the following is not an arithmetic operation?
Q13
Which operators of the following have same precedence? P. "!=", Q. "+=", R. "<<="
Q14
What will be the output of the following C code? #include <stdio.h> int main() { int x = -2; if (!0 == 1) printf("yes\n"); else printf("no\n"); }
Q15
Which keyword is used to declare a character array in C?
Q16
What will happen if the following C code is executed? #include <stdio.h> int main() { int main = 3; printf("%d", main); return 0; }
Q17
What is the highest index for an array with 10 elements in C?
Q18
String handling functions such as strcmp(), strcpy() etc can be used with enumerated types.
Q19
What will be the output of the following C code? #include <stdio.h> int main() { if (7 & 8) printf("Honesty"); if ((~7 & 0x000f) == 8) printf("is the best policy\n"); }
Q20
Point out the error (if any) in the following C code? #include<stdio.h> enum hello { a,b,c; }; main() { enum hello m; printf("%d",m); }
Q21
What will be the output of the following C code? #include <stdio.h> int main() { int a = 10, b = 5, c = 5; int d; d = a == (b + c); printf("%d", d); }
Q22
What will be the output of the following C code? #include<stdio.h> #define MAX 4 enum Shyam { a,b=3,c }; main() { if(MAX!=c) printtf("hello"); else printf("welcome"); }
Q23
What will be the output of the following C code? #include <stdio.h> int main() { int x = 1, y = 2; if (x && y == 1) printf("true\n"); else printf("false\n"); }
Q24
Which keyword is used to prevent any changes in the variable within a C program?
Q25
What will be the output of the following C code? #include <stdio.h> enum example {a = 1, b, c}; enum example example1 = 2; enum example answer() { return example1; } int main() { (answer() == a)? printf("yes"): printf("no"); return 0; }