in Programming in C
463 views
0 votes
0 votes

I want to know which evaluation is wrong here:

  1. a-b-c = ab-c-

      or a-b-c  = abc- –

  1. a * b *c = ab*c*

          a*b*c  =  abc**

     3 .    a+b-c = ab+c-

            a+b-c = abc-+

in Programming in C
463 views

4 Comments

Ans is option D

1. (--ABC) + D/E * (+FG)

2. (--ABC) + /DE * (+FG)

3. (--ABC) + */DE+FG

4. +--ABC*/DE+FG
0
0
When two operators have same preference, then associativity indecates which needs to evaluate further.

Your first statements are based upon left associativity, where second ones are based upon right associativities.

 

So first fix the associativity of operators, then try to convert into postfix/prefix
1
1
thank you
0
0

Please log in or register to answer this question.