Ex. - 2+2*3=12 and not 8. Means whichever operand comes first is evaluated



My code is

#include<stdio.h>
#include<conio.h>
#include<string.h>

int main()
{
char c[50],i=0,j=0,z;
gets(c);
i=strlen(c);
while(j<i)
{
switch(c[j])
{
case '+' : z=c[j-1]+c[j+1];
c[j+1]=z;
j++;
break;
case '-' : z=c[j-1]-c[j+1];
c[j+1]=z;
j++;
break;
case '*' : z=c[j-1]*c[j+1];
c[j+1]=z;
j++;
break;
case '/' : z=c[j-1]/c[j+1];
c[j+1]=z;
j++;
break;
default : j++;
break;
}
}
printf("\n%d",c[i-1]);
getch();
}

However I cannot get the right output..
Suggestions plzzzz..