0
5.5kviews
Write a program in C to evaluate postfix expression using STACK ADT

Topic: Application of Stack

Difficulty: High

Year(Marks): May2018(10 mks)

1 Answer
0
375views
        #include<stdio.h>
        #include<conio.h>

        int stack[20];
        int top = -1;

        void push(int x)
        {
            stack[++top] = x;
        }
        int pop()
        {
            return stack[top--];
        }

        void main()
        {
            char exp[20];
            char *e;
            int n1,n2,n3,num;
            clrscr();
            printf("Enter the expression :: ");
            scanf("%s",exp);
            e = exp;
            while(*e != '\0')
            {
                if(isdigit(*e))
                {
                    num = *e …

Create a free account to keep reading this post.

and 3 others joined a min ago.

Please log in to add an answer.