You are on page 1of 1

Instruction : Consider the infix notations below.

Convert
them to their PREFIX and POSTFIX value.
Before conversion distribute the following values : A=5, B=7, C=12,
D=18, E=9, F=15
1) B + A % ( C / 23 * P ) / R – Q
= 7 + 5 % (12 / 23 * P) / R – Q
 Prefix = + 7 - % 5 / / 12 * 23 P R Q
 Postfix = 7 5 12 23 / P * % R / + Q –

2) G – 45 + (A ^ C % 2 ) – D
= G – 45 + ( 5 ^ 12 % 2 ) - 18
 Prefix = - G + 45 - % ^ 5 12 2 18
 Postfix= G 45 - 5 12 ^ 2 % + 18 –

3) ( ( 90 / A +   B ) ^ M – E ) – C
= ( ( 90 / 5 + 7) ^ M – 9 ) – 12
 Prefix= - - ^ + / 90 5 7 M 9 C
 Postfix= 90 5 / 7 + M ^ 9 – 12 –

“I affirm that I have not given or received any unauthorized help on this assignment and
that this work is my own.”

You might also like