/*4. PROGRAM TO EVALUATE A POSTFIX EXPRESSION*/ #include #include #include #include float op(char symbol,float op1,float op2) { switch(symbol) { case '+':return(op1+op2); case '-':return(op1-op2); case '*':return(op1*op2); case '/':return(op1/op2); default : printf("\nType Missmatch\n"); getch(); return 0.0; } } void push(float item,int *top,float s[]) { s[++(*top)]=item; } float pop(int *top,float s[]) { float item; item=s[(*top)--]; return item; } void main() { float s[20],res,op1,op2; int i,top=-1; char postfix[30],symbol; clrscr(); printf("\nEnter the postfix expression\n"); scanf("%s",postfix); for(i=0;i