#include
#include
#include
#include
double compute(char symbol, double op1, double op2)
{
switch(symbol)
{
case '+': return op1 + op2;
case' -': return op1 - op2;
case '*': return op1 * op2;
case '/': return op1 / op2;
case '$': case '^': return pow(op1,op2);
default: return 0;
}
}
void main()
{
double s[20], res, op1, op2;
int top, i;
char postfix[20], symbol;
clrscr();
printf("\nEnter the postfix expression:\n");
flushall();
gets(postfix);
top=-1;
for(i=0;
SAMPLE OUTPUT: Enter the postfix expression: 23+ The result is: 5.000000