#Include #Include #Include #Define MAX 20
#Include #Include #Include #Define MAX 20
h>
#include <stdio.h>
#include <stdlib.h>
#define MAX 20
char stk[20];
int isEmpty(){
int isFull(){
char peek(){
return stk[top];
char pop(){
if(isEmpty())
return -1;
char ch = stk[top];
top--;
return(ch);
if(isFull())
printf("Stack Full!!!!");
else{
top++;
stk[top] = oper;
return (ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z');
switch (ch)
{
case '+':
case '-':
return 1;
case '*':
case '/':
return 2;
case '^':
return 3;
return -1;
int i, j;
if (checkIfOperand(expression[i]))
expression[++j] = expression[i];
else if (expression[i] == '(')
push(expression[i]);
expression[++j] = pop();
else
pop();
else // if an opertor
expression[++j] = pop();
push(expression[i]);
while (!isEmpty())
expression[++j] = pop();
expression[++j] = '\0';
int main()
covertInfixToPostfix(expression);
return 0;