Computer Science, asked by hiteshhukare28, 2 months ago

What is the value of the postfix expression 6,5,3,+,9,*+​

Answers

Answered by meelanshu
0

the distance selling regulations

Answered by yogeshkumar49685
0

Concept:

A single letter or operator preceded by two postfix strings forms a postfix expression. The first and second operands are followed by an operator in every postfix string longer than a single variable.

Given:

The postfix expression 6,5,3,+,9,*,+

Find:

The value of postfix expression.

Solution:

Step 1:

Push 6,5,3 into the stack.

Contents in the stack: 6,5,3

Step 2:

Pop 5,3 and perform addition (+). Now, push 8 into the stack.

Contents in the stack: 6,8.

Step 3:

Push 9 into the stack.

Step 4:

Pop 8,9 and perform multiplication. Now, push the result (72) into the stack.

Contents in the stack: 6, 72.

Step 5:

Pop 6, 72 and perform addition. Now, push the result into the stack.

Contents in the stack: 78.

Hence, the value of the expression is 78.

Similar questions