in Programming in C
907 views
0 votes
0 votes
Convert (A - B^C + H)*D + E^5.

Is the answer +*+-A^BCHD^E5 ?
in Programming in C
by
907 views

2 Answers

4 votes
4 votes
Best answer
Infix expression: A + B

prefix expression of above infix operation : +AB

similarly,

(A - B^C + H)*D + E^5

(A - (^BC) + H)*D + (^E5)

since  + and - are of same priority so follow left to right associativity

((-A^BC) + H)*D + (^E5)

(+-A^BCH)*D +(^E5)

(*+-A^BCHD) + (^E5)

+*+-A^BCHD^E5
selected by
0 votes
0 votes
yes it is correct..

Related questions

1 vote
1 vote
0 answers
3
Meenakshi Sharma asked in Programming in C Nov 13, 2016
349 views
Meenakshi Sharma asked in Programming in C Nov 13, 2016
349 views