Postfix notation is an unambiguous way of writing an arithme
Solution
#include<stdio.h>
#include<ctype.h>
#include<string.h>
char stack[30];
int top=-1;
int push(char);
int pop();
int priority(char);
void main()
{
char in[30],post[30],ch;
int i,j,l;
printf(“\ enter the string(infix Expression): “);
gets(in);
l=srtlen(in);
printf(“\ the length of the given string is: %d\ ”,l);
for(i=0,j=0;i<l;i++)
{
if(isalpha(in[i]) || isdigit(in[i]))
post[j++]=in[i];
else {
if(in[i]==‘(‘)
push(in[i]);
else if(in[i]==‘)’)
{
while ((ch=pop())!=‘(‘)
post[j++]=ch;
}
else
{
while(priority(in[i])<=priority(stack[top]))
post[j++]=pop();
push(in[i]);
}
} // end of else
} // end of for
while(top!=-1)
post[j++]=pop();
post[j]=\'\\0\';
printf(\"\ Equivalent infix to postfix is:%s \",post);
}//main
int priority (char c) {
switch(c) {
case \'+\':
case \'-\': return 1;
case \'*\':
case \'/\': return 2;
case \'$\': return 3;
case \'^\': return 4;
}//switch
return 0;
}//priority
int push(char c) {
stack[++top]=c;
return 0;
}//push
int pop(){
return (stack[top--]);
}//pop

