Evalpostfix
Evalpostfix
h>
#include <stdlib.h>
#define max 50
int stack[max];
int top = -1;
void push(int x)
{
if (top == max - 1)
{
printf("Stack Overflow");
return;
}
top++;
stack[top] = x;
}
int pop()
{
if (top == -1)
{
printf("\nStack Underflow");
return -1;
}
int ele = stack[top];
top--;
return ele;
}
Output:-