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
111. Find the output void main ( ) { int a=5, b=6, c=2, d; d=(a++, ++b, c++); printf("%d%d%d",d, a,a c); }
- 263
- 252
- 162
- 253
112. Find the output int x=5; void modify (int); void main ( ) { printf(%d",x); { x=10; modify(x); printf("%d',x); } printf("%d",x); } void modify (x); { x=15; x++; }
- 5 10 10
- 5 16 16
- Compilation error
- None of these
113. Find the output void main ( ) { int a=0; int b=20; char x=1; char y=10; if(x, b--, x--,x++) printf("%d",x); }
- 0
- 1
- 2
- None of the above
114. Find the output void main ( ) { int a=5 b=4, c=10 *((a>b) ? &a:&b)=(a+b>c); printf("%d\t%d", a, b); }
- 0 0
- 0 4
- Compilation error
- None of these
115. Find the output void main ( ) { int i=-3, j=2, k=0, m; m=++i&&++j||++k; printf("\n%d %d %d %d",i,j, k, m); }
- -2 3 0 1
- -3 2 0 1
- -2 3 1 1
- Compilation error
116. Find the output. void main ( ) { int x=10, y=10, z=5, i; i=x<y<z; printf("%d", i); }
- 0
- 1
- 10
- 5
117. Type conversion of small data type to higher data type is known as
- Coecion
- Type updation
- type promotion
- None of these
118. Find the output int define; #define define define+(a&b|c^d) #define define define=(a&b|c^d) void main ( ) { int a=1, b=2, c=3, d=4, e; if (define) printf("%d", define); }
- 0
- 7
- Compiler Error
- No Output
119. Find the output. void main ( ) { int i=4; i=i+1, i++; i=i+1, i+1; printf("%d", i); }
- 7
- 8
- 4
- 6
120. Find the output void main ( ) int c; { int a=5, b=10; c=a+b=-=a; printf("%d %d %d", a, b, c); }
- 10 10 5
- 5 10 5
- 10 5 10
- Compilation error