# Compilers Questions and Answers – Implementation of Increment and Decrement – 2

«
»

This set of Compilers Questions and Answers for Aptitude test focuses on “Implementation of Increment and Decrement – 2”.

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

Explanation: No other operator has higher precedence than arithmetic operator.

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

Explanation: 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?

`!((j + k) > (i + 5))`

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

Explanation: !((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 –

Explanation: 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

Explanation: 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

Explanation: The statements are true.

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

Explanation: Two integers are taken to be input.

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

Explanation: They are left associative.

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

Explanation: They are right associative.

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

Explanation: They left to right associative.

Sanfoundry Global Education & Learning Series – Compilers.

To practice all areas of Compilers for Aptitude test, here is complete set of 1000+ Multiple Choice Questions and Answers. 