### how i can Solution this ...?

hi ..
plezz how i can solution this algorethom

234*+
in Mathematics this solution
2 3*4+
2 12+
2+12
14
thx all
Build a postfix parser which has as side-effect the evaluation of the expression
thx bro but i need see the program ..
You'll have to write it, then.
 ```Using a stack For each item in the postfix expression from the left: if the element is a number push it on the stack if the element is an operator (+,-,*, or /) then pop two numbers off the stack make a calculation: the second number popped-operator-first number push the result on the stack When the loop is done the answer is the only item remaining on the stack.```
Last edited on
thats good bro ...
but : redface:
 ``12345678910111213141516171819202122232425262728`` ``````#include "stdio.h" #include "ctype.h" int main(){ int instr; int stack[100]; int sp=0; while((instr=getchar())!=EOF){ if(isdigit(instr)){ if(sp>=100){ fputs("stack overflow\n",stderr); continue; }else stack[sp++]=instr-'0'; }else if(sp-1<0){ fputs("stack underflow\n",stderr); continue; } else if(instr=='\n')printf("%d\n",stack[--sp]); else if(sp-2<0){ fputs("stack underflow\n",stderr); continue; } if(instr=='+')stack[sp-2]+=stack[sp-1],sp--; if(instr=='-')stack[sp-2]-=stack[sp-1],sp--; if(instr=='*')stack[sp-2]*=stack[sp-1],sp--; if(instr=='/')stack[sp-2]/=stack[sp-1],sp--; if(instr=='%')stack[sp-2]%=stack[sp-1],sp--; } }``````