Each question’s 1st statement is correct and the 2nd one is wrong.

Dark Mode

Overflow04
asked
in Programming
Oct 2

101 views
0 votes

I want to know which evaluation is wrong here:

- a-b-c = ab-c-

or a-b-c = abc- –

- a * b *c = ab*c*

a*b*c = abc**

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

a+b-c = abc-+

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

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