C Programming MCQ

1:

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

Explanation :
5-2-3*5-2 will yield 18, id it is treated as (5-(2-3))*(5-2). i.e., if - has precedence over* and if it associates from the right

Write your comments here:


Report Error
 

Option: A

Explanation : Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here. Explanation will come here.