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
91. Find the output void main ( ) { int i=48, j=50; printf(i>j?"%d':"%c", i, j); }
- 48
- 50
- 0
- 2
92. Which of the following operators have left to right associativity?
- =
- !
- %
- All of the above
93. Find the output void main ( ) { int a=-5; a>>=2; a<<=2; printf("%d",a); }
- -5
- -6
- -8
- None of these
94. Find the output if the values entered by the user are:100 200 300 void main ( ) { int a=1, b=2, c=3; scanf("%d %*d %d", &a, &b, &c); printf("a+%d b=%d c=%d', a, b, c); }
- 1 2 3
- 100 200 300
- 100 200 3
- 100 300 3
95. Find the output void main ( ) { int a[10]={'a', 1, 'b', 2, 'c', 3}, i=2; i<<2; for (i:i<6:i++) { if (a[i]>=97&&a[i]<=122) printf("%d", a[i]); } }
- 971982993
- 979899
- 123
- No output
96. Find the output if the values entered by the user are 123456 44 544 void main ( ) [ int a,b,c; scanf("%1d %2d %3d", &a, &b, &c); printf("Sum=%d", ab+c); }
- Sum=480
- Sum=594
- Sum=589
- None of these
97. Find the output void main ( ) { int i=5; i=++i + ++i + i++; printf("%d', i); }
- 21
- 22
- 19
- None of these
98. Find the output void main ( ) { int i=5; i=++i + +i + i++; i=++i + ++i + i++; printf("%d", i); }
- 21
- 22
- 19
- None of these
99. Find the output void main ( ) { int i=5; i=--i+i--; printf("5d", i); }
- 8
- 6
- 7
- None of these
100. Find theoutput void main ( ) { int a=1, b=2, c=3, d=4; printf("%d %d %d", a++, b-+c, d=a-b); }
- 1 5 -1
- 1 5 1
- 1 -1 -1
- Compilation error