C Operators Questions and Answers

Practice Mode
Showing 10 of 122 questions
Q91
Find the output void main ( ) { int i=48, j=50; printf(i>j?"%d':"%c", i, j); }
  • A 48
  • B 50
  • C 0
  • D 2
Answer: Option C
Q92
Which of the following operators have left to right associativity?
  • A =
  • B !
  • C %
  • D All of the above
Answer: Option C
Q93
Find the output void main ( ) { int a=-5; a>>=2; a<<=2; printf("%d",a); }
  • A -5
  • B -6
  • C -8
  • D None of these
Answer: Option C
Q94
Find the output if the values entered by the user are:100 200 300 void main ( ) { int a=1, b=2, c=3; scanf("%d %*d %d", &a, &b, &c); printf("a+%d b=%d c=%d', a, b, c); }
  • A 1 2 3
  • B 100 200 300
  • C 100 200 3
  • D 100 300 3
Answer: Option D
Q95
Find the output void main ( ) { int a[10]={'a', 1, 'b', 2, 'c', 3}, i=2; i<<2; for (i:i<6:i++) { if (a[i]>=97&&a[i]<=122) printf("%d", a[i]); } }
  • A 971982993
  • B 979899
  • C 123
  • D No output
Answer: Option D
Q96
Find the output if the values entered by the user are 123456  44  544 void main ( ) [ int a,b,c; scanf("%1d %2d %3d", &a, &b, &c); printf("Sum=%d", ab+c); }
  • A Sum=480
  • B Sum=594
  • C Sum=589
  • D None of these
Answer: Option A
Q97
Find the output void main ( ) { int i=5; i=++i + ++i + i++; printf("%d', i); }
  • A 21
  • B 22
  • C 19
  • D None of these
Answer: Option B
Q98
Find the output void main ( ) { int i=5; i=++i + +i + i++; i=++i + ++i + i++; printf("%d", i); }
  • A 21
  • B 22
  • C 19
  • D None of these
Answer: Option B
Q99
Find the output void main ( ) { int i=5; i=--i+i--; printf("5d", i); }
  • A 8
  • B 6
  • C 7
  • D None of these
Answer: Option C
Q100
Find theoutput void main ( ) { int a=1, b=2, c=3, d=4; printf("%d %d %d", a++, b-+c, d=a-b); }
  • A 1 5 -1
  • B 1 5 1
  • C 1 -1 -1
  • D Compilation error
Answer: Option C
Questions and Answers for Competitive Exams Various Entrance Test