C Operators Questions and Answers

Practice Mode
Showing 10 of 122 questions
Q31
Find the output void main ( ) { int x=10, y=5, p, q; p=x>9; q=p ||(x=5, y=10); printf("%d %d %d", q,x,y); }
  • A 1 10 5
  • B 0 10 5
  • C 1 5 10
  • D Compilation error
Answer: Option A
Q32
Find the output void main( ) { int x=-2; x=-x-x+x; printf("%d", x); }
  • A 0
  • B 2
  • C 4
  • D None of these
Answer: Option B
Q33
Masking is a technique
  • A To set a binary number or bit pattern to zero.
  • B To set a binary number or bit pattern to one.
  • C To set a binary number or bit pattern to zero to one and vice versa.
  • D None of these
Answer: Option C
Q34
Find the output void main ( ) { int a, b, c; a=1, b=2, c=3; a=a?b:c; c=-b?a:c; printf("%d %d", a, c); }
  • A 3 3
  • B 2 3
  • C 2 2
  • D None of these
Answer: Option C
Q35
Find the output. void main ( ) { int x=2, y=1; y+=x<<=2; printf(%d %d", x,y); }
  • A 2 9
  • B 8 8
  • C 3 8
  • D 8 9
Answer: Option D
Q36
Find the output. void main ( ) { int x=-5u; int y=5; y=y>x?y/x:x/y; printf("%u",y); }
  • A 13106
  • B -1
  • C 65535
  • D 5
Answer: Option C
Q37
Find the output. void main ( ) { int a,b, sum=0; sum=(a=5,b=9, ++a+ ++b); printf("%d", sum);
  • A 16
  • B 5
  • C 10
  • D Compilation error
Answer: Option A
Q38
b++ executes faster than b+1 because
  • A b++ uses register
  • B Single machine instruction is required for b++
  • C Both a and b are true
  • D None of these
Answer: Option B
Q39
Find the output void main ( ) { int x,y,z; z=(x=3) && (y=7) &10; printf ("%d", z);
  • A 0
  • B 1
  • C No output
  • D None of these
Answer: Option B
Q40
Find the output. void main ( ) { int x,y,z; x=2; y=4; z=y++*x++ | y--; printf("%d", z); }
  • A 13
  • B 28
  • C 24
  • D 12
Answer: Option D
Questions and Answers for Competitive Exams Various Entrance Test