C Operators Questions and Answers

Practice Mode
Showing 10 of 122 questions
Q71
Find the output void main ( ) { int i=5; if(i=i++ - i) { printf("%d", i); printf("Hello"); } else { printf ("%d", i); printf('Hi"); } }
  • A -1Hello
  • B -1Hi
  • C 0Hello
  • D 0Hi
Answer: Option A
Q72
Find theoutput void main ( ) { int x=2, y=3, z; z=x++||y++&&x++; printf("%d %d %d', x,y,z); }
  • A 3 3 1
  • B 4 4 1
  • C 4 3 1
  • D None of these
Answer: Option A
Q73
Find the output void main ( ) { int a=3, b=5, c; c=a, b; printf("%d', c, ++c, ++c); }
  • A 5
  • B 6
  • C 7
  • D Compilation error
Answer: Option A
Q74
Find the output void main ( ) { int i=5; i=i++ * i++; printf("%d', i); }
  • A 25
  • B 27
  • C 49
  • D 30
Answer: Option B
Q75
Find the output void main ( ) { int x=1, y=2, z; z=x++&&y++|| ++y; printf ("%d %d", x, y, z); }
  • A 1 2 1
  • B 2 3 1
  • C 2 4 1
  • D None of these
Answer: Option B
Q76
Find the output void main ( ) { int a; a=sum (2,3); printf('%d", a); } int sum(int a, int b) { a>=1&&b>=1? return (a+b) : return (a-b); }
  • A 5
  • B -1
  • C Compilation error
  • D None of these
Answer: Option C
Q77
Find the output void main ( ) { int x=1, y=3, z=0; if(x!=y>=z) printf ("Right"); else printf("wrong"); }
  • A Right
  • B Wrong
  • C Compilation error
  • D None of these
Answer: Option B
Q78
Find the output void main ( ) { int i=1; i=(5>2)?printf('Rama") :printf ("Shyama"); printf("%d",i); }
  • A Rama1
  • B Rama4
  • C Rama0
  • D None of these
Answer: Option B
Q79
Find theoutput void main ( ) { int a=5, b=-5, c=1, d; d=(a>b)?a;b)* (c=0?c:-c); }
  • A 5
  • B -5
  • C 1a
  • D 0
Answer: Option B
Q80
Find the output void main ( ) { int i=2, j=0; j=++ % ++i; printf ("5d", j); }
  • A 0
  • B 1
  • C 3
  • D None of these
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test