C Operators Questions and Answers

Practice Mode
Showing 10 of 122 questions
Q41
Find the output. void main ( ) { int a,b,c,d; a=5; b=6; c=7; d=a &=b&=c &&a; printf("%d", d); }
  • A 0
  • B 1
  • C Compilation error
  • D No output
Answer: Option A
Q42
Find the output. void main ( ) { int a, b, c d; a=5; b=6; c=7; d=a &=b&=c &&a; printf("%d",d);
  • A 0
  • B 1
  • C Compilation error
  • D No output
Answer: Option A
Q43
Find the output. void main ( ) { float a=5,b=2; int c; c=a%b; printf(%d", c); }
  • A 1
  • B 0
  • C Compilation error
  • D None of these
Answer: Option C
Q44
Cast operator returns
  • A L value
  • B Rvalue
  • C Integral value
  • D None of these
Answer: Option B
Q45
Find the output void main ( ) int i=10; i=(10<10)? (10>=10)? i=(10<10)? (10>=10)? (10<=10)?1:2:3:4); printf("%d",i); }
  • A 1
  • B 2
  • C 3
  • D 4
Answer: Option D
Q46
Find the output. void main( ) { int a=b=2; printf("%d %d", a++, ++b); }
  • A 2 3
  • B 3 3
  • C 3 2
  • D Compilation error
Answer: Option D
Q47
How to get a correct result for 2/3? I. 2.0/3 II. (float)2/3 III. float(2/3)
  • A Only I
  • B Only III
  • C Both I & II
  • D Both I & III
Answer: Option C
Q48
Find the output. void main () [ int x=5; printf("%d", x*++x/--x); }
  • A 5
  • B 6
  • C 7
  • D None of these
Answer: Option C
Q49
Find the output void main ( ) { int a, b; a=b=2; a=a++ + ++b; printf("%d", a++);
  • A 5
  • B 6
  • C 7
  • D 8
Answer: Option B
Q50
Find the output void main ( ) { int x=300*250/100; printf("%d", x); }
  • A 94
  • B 81
  • C 54
  • D 71
Answer: Option A
Questions and Answers for Competitive Exams Various Entrance Test