Convert the following expression to postfix and prefix
X $ Y Z - M + N + P / Q / (R + S)

Answer Posted / test

postfix

Z-M+N+P/Q/(R+S)

z-m-n+p/q/rs+

z-m-n+pq//rs+

z-m-n+pq/rs+/
zm- -n+pq/rs+/
zm-n- +pq/rs+/
zm-n-pq/rs+/+

prefix

Z-M+N+P/Q/(R+S)

z-m+n+p/q/+(rs)

z-m+n+//pq+(rs)

-zm+n+//pq+(rs)

+-zmn+//pq+(rs)
++-zmn//pq+(rs)

Is This Answer Correct ?    8 Yes 7 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an array in c?

597


Which header file is essential for using strcmp function?

945


In c programming typeing to occupy the variables in memory space. if not useing the variable the memory space is wasted.ok, how to avoid the situation..? (the variable is used & notused)

1633


Why should I use standard library functions instead of writing my own?

674


Explain the ternary tree?

601






Calculate 1*2*3*____*n using recursive function??

1517


Find the second largest element in an array with minimum no of comparisons and give the minimum no of comparisons needed on an array of size N to do the same.

720


What is the difference between class and object in c?

583


PROGRAM TO WRITE CONTENTS OF 1 FILE IN REVERSE TO ANOTHER FILE,PROGRAM TO COPY 1 FILE TO ANOTHER BY SPECIFYING FILE NAMES AS COMMAND LINE

1470


#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }

666


program for reversing a selected line word by word when multiple lines are given without using strrev

1947


What is conio h in c?

624


What is a static variable in c?

667


What is function and its example?

626


What is the difference between ā€˜gā€™ and ā€œgā€ in C?

2544