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
71. Find the output void main ( ) { int i=5; if(i=i++ - i) { printf("%d", i); printf("Hello"); } else { printf ("%d", i); printf('Hi"); } }
- -1Hello
- -1Hi
- 0Hello
- 0Hi
72. Find theoutput void main ( ) { int x=2, y=3, z; z=x++||y++&&x++; printf("%d %d %d', x,y,z); }
- 3 3 1
- 4 4 1
- 4 3 1
- None of these
73. Find the output void main ( ) { int a=3, b=5, c; c=a, b; printf("%d', c, ++c, ++c); }
- 5
- 6
- 7
- Compilation error
74. Find the output void main ( ) { int i=5; i=i++ * i++; printf("%d', i); }
- 25
- 27
- 49
- 30
75. Find the output void main ( ) { int x=1, y=2, z; z=x++&&y++|| ++y; printf ("%d %d", x, y, z); }
- 1 2 1
- 2 3 1
- 2 4 1
- None of these
76. 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); }
- 5
- -1
- Compilation error
- None of these
77. Find the output void main ( ) { int x=1, y=3, z=0; if(x!=y>=z) printf ("Right"); else printf("wrong"); }
- Right
- Wrong
- Compilation error
- None of these
78. Find the output void main ( ) { int i=1; i=(5>2)?printf('Rama") :printf ("Shyama"); printf("%d",i); }
- Rama1
- Rama4
- Rama0
- None of these
79. Find theoutput void main ( ) { int a=5, b=-5, c=1, d; d=(a>b)?a;b)* (c=0?c:-c); }
- 5
- -5
- 1a
- 0
80. Find the output void main ( ) { int i=2, j=0; j=++ % ++i; printf ("5d", j); }
- 0
- 1
- 3
- None of these