250+ TOP MCQs on Implementation of Increment and Decrement

Compilers Questions and Answers for Aptitude test on “Implementation of Increment and Decrement”.

1. In C programming language, which of the following type of operators have the highest precedence?
a) Relational Operators
b) Equality Operators
c) Logical Operators
d) Arithmetic Operators

Answer: d
Clarification: No other operator has higher precedence than arithmetic operator.

2. Which of the following operators has the highest precedence?
a) Unary +
b) *
c) >=
d) ==

Answer: a
Clarification: Unary operators have max precedence in over all other arithmetic operators.

3. If i=1 j=2,k=3, then what is the value of the following expression?

a) 6
b) 5
c) 1
d) 0

Answer: c
Clarification: !((2+3)>(1+5))
!(5>6)
Since the condition is false hence !(0)
And complement of 0 is 1.

4. The expression 5 – 2 – 3 * 5 – 2 will evaluate to 18, if – is left associative and _____________
a) * has precedence over *
b) * has precedence over –
c) – has precedence over *
d) – has precedence over –

Answer: c
Clarification: if – has precedence over* and if it associates from the right.

5. Coercion _____________
a) Takes place over an assignment operator
b) Operator has operands of various types
c) None of the mentioned
d) Takes place over an assignment operator & Operator has operands of various types

Answer: d
Clarification: Conversion between compatible types.

6. Choose the correct statement.
a) Expressions evaluated at compile time
b) String constants concatenated at compile time
c) None of the mentioned
d) Both of the mentioned

Answer: d
Clarification: The statements are true.

7. Which of the following operators takes only integer operands?
a) +
b) *
c) /
d) %

Answer: d
Clarification: Two integers are taken to be input.

8. Pick the operators that associate from the left.
a) +
b) ,
c) <
d) All of the mentioned

Answer: d
Clarification: They are left associative.

9. Pick the operators that associate from the right.
a) ?:
b) +=
c) =
d) All of the mentioned

Answer: d
Clarification: They are right associative.

10. Pick the operators that associate from left to right.
a) &&
b) ?:
c) ,
d) All of the mentioned

Answer: d
Clarification: They left to right associative.

Leave a Reply

Your email address will not be published. Required fields are marked *