Question 1 of 25
Hints left: 3
Q1
Which function in the following expression will be called first? a = func3(6) - func2(4, 5) / func1(1, 2, 3);
Q2
What will be the output of the following C code? #include <stdio.h> int main() { enum {ORANGE = 5, MANGO, BANANA = 4, PEACH}; printf("PEACH = %d\n", PEACH); }
Q3
What will be the output of the following C code? #include <stdio.h> void main() { int k = 8; int x = 0 == 1 && k++; printf("%d%d\n", x, k); }
Q4
What will be the final value of c in the following C statement? (Initial value: c = 2) c <<= 1;
Q5
What will be the output of the following C code? #include <stdio.h> int main() { printf("Hello World! %d \n", x); return 0; }
Q6
What will be the output of the following C code? #include <stdio.h> void main() { char a = '0'; char b = 'm'; int c = a && b || '1'; printf("%d\n", c); }
Q7
What is the type of the following assignment expression if x is of type float and y is of type int? y = x + y;
Q8
What will be the output of the following C code? #include<stdio.h> enum colour { blue, red, yellow }; main() { enum colour c; c=yellow; printf("%d",c); }
Q9
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); }
Q10
What will be the final value of x in the following C code? #include <stdio.h> void main() { int x = 5 * 9 / 3 + 9; }
Q11
Consider this statement: typedef enum good {a, b, c} hello; Which of the following statements is incorrect about hello?
Q12
What will be the output of the following C code? #include <stdio.h> void main() { int x = 4, y, z; y = --x; z = x--; printf("%d%d%d", x, y, z); }
Q13
What will be the output of the following C code? #include <stdio.h> void main() { double x = 123828749.66; int y = x; printf("%d\n", y); printf("%lf\n", y); }
Q14
What will be the output of the following C code? #include<stdio.h> enum Ram { a=1,b }; enum Shyam { c,d }; int main() { enum Shyam s1=c; enum Shyam s=a; enum Ram s2=d; printf("%d",s); printf("%d",s1); printf("%d",s2); }
Q15
What will be the output of the following C code? (Initial values: x= 7, y = 8) #include <stdio.h> void main() { float x; int y; printf("enter two numbers \n"); scanf("%f %f", &x, &y); printf("%f, %d", x, y); }
Q16
What will be the output of the following C code? #include<stdio.h> int main() { typedef union a { int i; char ch[2]; }hello; hello u; u.ch[0] = 3; u.ch[1] = 2; printf("%d, %d", u.ch[0], u.ch[1]); return 0; }
Q17
Comment on the behaviour of the following C code? #include <stdio.h> int main() { int i = 2; i = i++ + i; printf("%d\n", i); }
Q18
What will be the output of the following C code? #include <stdio.h> int main() { int ThisIsVariableName = 12; int ThisIsVariablename = 14; printf("%d", ThisIsVariablename); return 0; }
Q19
What will be the output of the following C code? #include <stdio.h> int main() { int x = 2, y = 2; int z = x ^ y & 1; printf("%d\n", z); }
Q20
What will be the output of the following C code? #include <stdio.h> void main() { int h = 8; int b = h++ + h++ + h++; printf("%d\n", h); }
Q21
Which of the following is not a valid variable name declaration?
Q22
Which of the following is possible with any 2 operators in C?
Q23
What will be the output of the following C code? #include <stdio.h> int main() { int x = 1; short int i = 2; float f = 3; if (sizeof((x == 2) ? f : i) == sizeof(float)) printf("float\n"); else if (sizeof((x == 2) ? f : i) == sizeof(short int)) printf("short int\n"); }
Q24
Which of the following operator has the highest precedence in the following?
Q25
Which of the following is not a pointer declaration?