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
21. Find the outpu void main ( ) { int i=5; if (i++ -1) { printf("%d", i); printf("%Hello"); } }
- 1Hello
- 1hi
- 6hello
- 0Hi
22. Find the output void main ( ) { int x=5; printf("%d%d", x++,x++,x++); }
- 5 6 7
- 7 6 5
- 6 7 8
- None of these
23. The operators[] . and -> are known as
- Data access operators
- Structure access operators
- Member access operators
- None of these
24. Find the output void main ( ) { int x=2; printf("%d',++x++); printf("%d', x++); }
- 3 4
- 3 5
- 4 3
- Compilation error
25. Find the output void call (int); void main ( ) { call (3); } void call (int a) { if (a<6) call (++a); printf ("%d", a); }
- 4 5 6
- 6 5 4 3
- 6 6 5 4
- 5 5 4
26. The order of evaluation of operators having same precedence is decided by
- associativity rule
- Precedence rule
- Left-right rule
- Right-left rule
27. Find the output void main ( ) { int x=1; printf("%d==1 is "'%s", k, k==1 ? 'TRUE": "FALSE"); }
- 0==1 is FALSE
- 1==1 is TRUE
- Compilation error
- Garbage Output
28. Find the output void main ( ) { printf("%*d", 10, 15); }
- *15
- *10
- 15 on column 10
- 10 on column 15
29. Find the output void main ( ) int i=5; i= i++ - --i + ++i; printf("%d", i); }
- 5
- 7
- 8
- None of these
30. Find the output void main ( ) { int a=7; a+=a+=a-=6; printf("%d",a); }
- 15
- 4
- 11
- 3