Hi. . can any one help me in converting infix to postfix. . i do not know what is wrong in my code. . help!!!plz
#include<iostream>
#include<string>
#include<conio.h>
#include<stdio.h>
using namespace std;
void main()
{
char stack[10];
char input[10];
char output[10];
char plusminus,multdiv;
int a;
cout<<"\tInput an infix expression:";
gets(input);
int i;
i=strlen(input);
cout<<strlen(input);
for(a=0;a<=i;a++){
if(input[a]>='a'&&input[a]<='z'){
output[a]=input[a];
}
else if(input[a]=='+'||input[a]=='-'){
plusminus=input[a];
}
else if(input[a]=='*'||input[a]=='/'){
multdiv=input[a];
}
if(input[a]==plusminus){
stack[a]=input[a];
if(stack[a]==plusminus&&stack[a+1]==plusminus){
output[a]=stack[a];
}
}
else if(input[a]==multdiv){
stack[a]=input[a];
if(stack[a]==multdiv&&stack[a+1]==multdiv){
output[a]=stack[a];
}
}
}
cout<<"\tPostfix Expression :"<<output<<"\n";
}