C Operators Questions and Answers

Practice Mode
Showing 10 of 122 questions
Q51
Find the output void main ( ) { int a=10, b=20; a=(a>5 || b=6? 40:50); printf("%d", a); }
  • A 40
  • B 50
  • C 10
  • D Compilation error
Answer: Option D
Q52
Arrange the operators ~, == &&, *,^ in the increasing order of precedence.
  • A ==,^,*&&,~
  • B &&, ^, ==,*, ~
  • C *,++,&&, ^, ~
  • D &&, ==, ^,*,~
Answer: Option B
Q53
Find the output void main ( ) { int x=16384, y=1; x<<=y; printf("%d",x); }
  • A 32768
  • B -32768
  • C 0
  • D Compilation error
Answer: Option B
Q54
Find the output. void main ( ) { printf("%x",-1<<4); }
  • A 0010
  • B 1010
  • C fff0
  • D ffff
Answer: Option C
Q55
Simple encryption can be done using
  • A ^
  • B ~
  • C Both a and B
  • D All of the above
Answer: Option C
Q56
Find the output void main ( ) { int p=3, q=-5, x=4, y=2, z; z=p+++ ++q*y/x; printf("%d', z); }
  • A 0
  • B 1
  • C -2
  • D None of these
Answer: Option B
Q57
Find the output void main ( ) { int x=7; x=(x<<=x%2) printf("%d",x); }
  • A 7
  • B 14
  • C 0
  • D Compilation error
Answer: Option B
Q58
Find the output void main ( ) { int a=2, b=5, c=1; printf(%d", (b>=a>=0?1:0); }
  • A 1
  • B 0
  • C Compilation error
  • D None of these
Answer: Option A
Q59
Find the output. void main ( ) { int x=1; if (x++>=x) printf("%d",x); else printf("%d", ++x); }
  • A 2
  • B 3
  • C Compilation error
  • D None of these
Answer: Option B
Q60
The correct order of evaluation for the expression a=b- =c*=5 is
  • A b-=c, (b-=c)*=5, a=(b-=c)*=5)
  • B c*=5, b-=(c*=5), a=(b-=(c*=5))
  • C b-=c, a=(b-=c), (a=(b-=c))c*=5
  • D None of these
Answer: Option B
Questions and Answers for Competitive Exams Various Entrance Test