Reverse Ploish notation Calculator : I am currently working on a RPN calculator, it takes an infix expression converts it to postfix and shows the answer. I mostly got it right, but when I pop the answer from the stack if shows only the last digit of the result 
ex Enter infix: (1+1)*13+10/2
Postfix: 11+13*102/+
Result is: 1
Enter infix: 2*13+10/2
Postfix: 213*102/+
Result is:1

It gets it right for this kind of inputs
Enter infix: 3*2+5
Postfix: 32*5+
Result is : 11


    #include<iostream>
    #include<stdio.h>
    #include<string.h>
    #include<math.h>
    #include<stdlib.h>

    using namespace std;

    class infix2postfix
    {
    public:
    void push(int symbol);
    int pop();
    void infix_to_postfix();
    int priority(char symbol);
    int isEmpty();
    int white_space(char);
    int eval_post();
    };

    char infix[100], postfix[100];
    int stack[100];
    int top;

    int main()
    {
    infix2postfix ip;
    top=-1;
    cout<<"Enter infix : ";
    gets(infix);
    ip.infix_to_postfix();
    cout<<"Postfix : "<<postfix<<endl;
    cout<<"Result is : "<<ip.eval_post()<<endl;
    return 1;
    }

    void infix2postfix :: infix_to_postfix()
    {
    int i,p=0;
    char next;
    char symbol;
    for(i=0; i<strlen(infix); i++)
    {
        symbol=infix[i];
        if(!white_space(symbol))
        {
            switch(symbol)
            {
            case '(':
                push(symbol);
                break;
            case ')':
                while((next=pop())!='(')
                    postfix[p++] = next;
                break;
            case '+':
            case '-':
            case '*':
            case '/':
            case '%':
            case '^':
                while( !isEmpty( ) &&  priority(stack[top])>= priority(symbol) )
                    postfix[p++]=pop();
                push(symbol);
                break;
            default: /*if an operand comes*/
                postfix[p++]=symbol;
            }
        }
    }
    while(!isEmpty( ))
        postfix[p++]=pop();
    postfix[p]='\0'; /*End postfix with'\0' to make it a string*/
    }

    /*This function returns the priority of the operator*/
    int infix2postfix :: priority(char symbol)
    {
    switch(symbol)
    {
    case '(':
        return 0;
    case '+':
    case '-':
        return 1;
    case '*':
    case '/':
    case '%':
        return 2;
    case '^':
        return 3;
    default :
        return 0;
    }
    }

    void infix2postfix :: push(int symbol)
    {
    if(top>100)
    {
        cout<<"Stack overflow\n";
        exit(1);
    }
    stack[++top]=symbol;
    }

    int infix2postfix :: pop()
    {
    if( isEmpty() )
    {
        cout<<"Stack underflow\n";
        exit(1);
    }
    return (stack[top--]);
    }


    int infix2postfix :: isEmpty()
    {
    if(top==-1)
        return 1;
    else
        return 0;
    }

    int infix2postfix :: white_space(char symbol)
    {
    if( symbol == ' ' || symbol == '\t' )
        return 1;
    else
        return 0;
    }

    int infix2postfix :: eval_post()
    {
    int a,b,i,temp,result;
    for(i=0; i<strlen(postfix); i++)
    {
        if(postfix[i]<='9' && postfix[i]>='0')
            push(postfix[i]-'0');
        else
        {
            a=pop();
            b=pop();
            switch(postfix[i])
            {
            case '+':
                temp=b+a;
                break;
            case '-':
                temp=b-a;
                break;
            case '*':
                temp=b*a;
                break;
            case '/':
                temp=b/a;
                break;
            case '%':
                temp=b%a;
                break;
            case '^':
                temp=pow(b,a);
            }
            push(temp);
        }
    }
    result=pop();
    return result;
    }
