C Operators Questions and Answers
Operators in C are symbols that perform operations on variables and values, forming the basis of all computational logic. Questions on C operators, including arithmetic, logical, relational, and bitwise operators, are common in programming questions and answers for campus placements and technical interviews. Companies like Infosys, Wipro, and TCS often include C operator problems in their online coding tests. This section provides in-depth C operator questions with solutions and explanations to help learners understand operator precedence, associativity, and expression evaluation.
C Operators
Showing 10 of
122 questions
41. Find the output. void main ( ) { int a,b,c,d; a=5; b=6; c=7; d=a &=b&=c &&a; printf("%d", d); }
- 0
- 1
- Compilation error
- No output
42. Find the output. void main ( ) { int a, b, c d; a=5; b=6; c=7; d=a &=b&=c &&a; printf("%d",d);
- 0
- 1
- Compilation error
- No output
43. Find the output. void main ( ) { float a=5,b=2; int c; c=a%b; printf(%d", c); }
- 1
- 0
- Compilation error
- None of these
45. 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); }
- 1
- 2
- 3
- 4
46. Find the output. void main( ) { int a=b=2; printf("%d %d", a++, ++b); }
- 2 3
- 3 3
- 3 2
- Compilation error
47. How to get a correct result for 2/3? I. 2.0/3 II. (float)2/3 III. float(2/3)
- Only I
- Only III
- Both I & II
- Both I & III
48. Find the output. void main () [ int x=5; printf("%d", x*++x/--x); }
- 5
- 6
- 7
- None of these
49. Find the output void main ( ) { int a, b; a=b=2; a=a++ + ++b; printf("%d", a++);
- 5
- 6
- 7
- 8
50. Find the output void main ( ) { int x=300*250/100; printf("%d", x); }
- 94
- 81
- 54
- 71