C Operators Questions and Answers

Practice Mode
Showing 10 of 122 questions
Q101
Find the output void main ( ) { unsigned int i=2; i=(((i<<6)-1)^127||(i+3>>3)); printf("%u",i); }
  • A 27
  • B 0
  • C Garbage value
  • D Compilation error
Answer: Option B
Q102
Find the output void main ( ) { int i=1; i= i + 2*i++ + -i; printf ("i is now %d", is); }
  • A i is now 3
  • B i is now 4
  • C i is now 2
  • D None of these
Answer: Option A
Q103
Find the output void main ( ) { int x=10; printf(5d %d %d", x==10, x=20, x<20); }
  • A 1 20 0
  • B 1 20 1
  • C 0 20 1
  • D None of these
Answer: Option C
Q104
Find the output void main( ) { int a=3, b=4, c; c=b==4||a!=3; printf ("%d", c} }
  • A 0
  • B 1
  • C Compilation error
  • D None of these
Answer: Option B
Q105
Find the output void main ( ) { int a, b, c,  d, e; e=++a&&++b||--c&&d++; printf("%d",e); }
  • A 0
  • B 1
  • C Error
  • D None of these
Answer: Option B
Q106
Find the output void main ( ) { int a=2, b=6, c=5; c*=a+b; printf ("%d", c); }
  • A 16
  • B 30
  • C 40
  • D None of these
Answer: Option C
Q107
Find the output printf ("5s", #CAcademy);
  • A CAAcademy
  • B Academy
  • C Compile time error
  • D Runtime error
Answer: Option C
Q108
Find the output void main ( ) { int i=-1, j=-1, k=0, 1=2, m; m=i++&&j++&&k++||1++; printf("%d %d %d %d", i,j,k, 1,m); }
  • A 0 0 0 0 0
  • B 0 0 1 3 1
  • C 1 1 1 3 1
  • D 0 -1 0 2 0
Answer: Option B
Q109
Find the output void main ( ) { int a=5, b=6, c=2, d; d=(a++, ++b, c++); printf("%d%d%d",d,a,ac); }
  • A 263
  • B 252
  • C 162
  • D 253
Answer: Option A
Q110
Unary operators are
  • A Operator dependant
  • B Position dependant
  • C Value dependant
  • D Both b and c
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test