C Operators Questions and Answers

Practice Mode
Showing 10 of 122 questions
Q81
Find the output void main ( ) { int x, y=2, z=3; z=(x&y!=z%x); printf("%d",z); }
  • A 1
  • B 0
  • C Compilation error
  • D None of these
Answer: Option B
Q82
Find the output void main ( ) { int i=10, j=2, k=0; for (j=1, j<i;j=2*(i/j)) k+=j<y?2:3; printf("%d",k); }
  • A 2
  • B 3
  • C 6
  • D None of these
Answer: Option A
Q83
Pick the operator whose meaning is context dependent.
  • A *
  • B #
  • C &
  • D All of the above
Answer: Option B
Q84
Logical left shift results in
  • A Maintaining the left most bit value.
  • B Zero is shifted to rightmost bit position
  • C Zero is shifted to rightmost bit position.
  • D One is shifted to leftmost bit position
Answer: Option C
Q85
find the output void main ( ) { int i=2, j=3, k, 1=0; k-sizeof (1=i*j+6); printf("%d %d", k, 1); }
  • A 2 0
  • B 2 12
  • C 0 0
  • D Garbage value
Answer: Option A
Q86
Find the output void main ( ) { int a=5, b=10; b=(a, b) ? (a, 0) ? a:b:b; printf ("%d %d", a, b); }
  • A 5 10
  • B 10 5
  • C Garbage values
  • D Compilation error
Answer: Option A
Q87
Find theoutput void main ( ) { int i=5; for (i=-5; ! i, i++); printf ("%d", -i); }
  • A 5
  • B 0
  • C -5
  • D None of these
Answer: Option B
Q88
Find the output void main ( ) int a=2, b=3, c=0; if (a, b&&c) printf 9"Hell"); else printf("Dear"); }
  • A Hello
  • B Dear
  • C Compilation error
  • D None of these
Answer: Option B
Q89
Find theoutput void main ( ) { int i=4; i=i+2*i--; printf("%d", i); }
  • A 24
  • B 20
  • C 11
  • D None of these
Answer: Option C
Q90
Find the output void main ( ) { int a=1, b=2, c=3, d=4; printf ("%d', !a?b?!c:!d:a); }
  • A 1
  • B 2
  • C 3
  • D 4
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test