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
81. Find the output void main ( ) { int x, y=2, z=3; z=(x&y!=z%x); printf("%d",z); }
- 1
- 0
- Compilation error
- None of these
82. Find the output void main ( ) { int i=10, j=2, k=0; for (j=1, j<i;j=2*(i/j)) k+=j<y?2:3; printf("%d",k); }
- 2
- 3
- 6
- None of these
84. Logical left shift results in
- Maintaining the left most bit value.
- Zero is shifted to rightmost bit position
- Zero is shifted to rightmost bit position.
- One is shifted to leftmost bit position
85. find the output void main ( ) { int i=2, j=3, k, 1=0; k-sizeof (1=i*j+6); printf("%d %d", k, 1); }
- 2 0
- 2 12
- 0 0
- Garbage value
86. Find the output void main ( ) { int a=5, b=10; b=(a, b) ? (a, 0) ? a:b:b; printf ("%d %d", a, b); }
- 5 10
- 10 5
- Garbage values
- Compilation error
87. Find theoutput void main ( ) { int i=5; for (i=-5; ! i, i++); printf ("%d", -i); }
- 5
- 0
- -5
- None of these
88. Find the output void main ( ) int a=2, b=3, c=0; if (a, b&&c) printf 9"Hell"); else printf("Dear"); }
- Hello
- Dear
- Compilation error
- None of these
89. Find theoutput void main ( ) { int i=4; i=i+2*i--; printf("%d", i); }
- 24
- 20
- 11
- None of these
90. Find the output void main ( ) { int a=1, b=2, c=3, d=4; printf ("%d', !a?b?!c:!d:a); }
- 1
- 2
- 3
- 4