I made a program to convert an expression to postfix and then evaluate it!! But I don't know what modifications i should do to to make it work for more than 2 digit numbers!!
for eg. 2+3
will give 23+ as postfix expression and sum 5
But 23+5 wont work !
PLEASE HELP!!!
My code is as follows:
#include<math.h>
#include<stdio.h>
#include<conio.h>
#include<string.h>
char stack[50];
int stk[50];
int top=0,top2=0;
void calc();
void postfx(char infix[]);
void push(char symbol);
char pop();
int precedence(char ch);
int isdigit(int a);
int Pop();
void Push2(int symbol);
void Evaluate();
static int pos=0;
char postfix[40];
void main()
{
char infix[25];
printf("Enter the expression:");
gets(infix);
postfx(infix);
getch();
}
void postfx(char infix[])
{
int l;
static int i=0;