Language: C

#include<stdio.h>
#define MAX 1000

int top;
int S[MAX];

void initialize(){
       return top=0;
       }

void isempty(){
       return top==0;
       }

void isfull(){
       return top>=MAX-1;
       }

void push(int n){
       if (isfull()){printf("overflow\n");exit(1);}

       top++;
       S[top]=n;
       }

int pop(){
       if (isempty()){printf("overflow\n");exit(1);}

       top--;
       return S[top+1];
       }

int main(){
       int i,j,x,y,z;
       char op[MAX];
       initialize();
       while(scanf("%s",&op) != EOF){
                   if(op=='+'){
                               x=pop();
                               y=pop();
                               z=x+y;
                               push(z);
                               }
                   else if(op=='-'){
                               x=pop();
                               y=pop();
                               z=x-y;
                               push(z);
                               }
                   else if(op=='*'){
                               x=pop();
                               y=pop();
                               z=x*y;
                               push(z);
                               }
                   else {push(atoi(op));}
                   }
          printf("%d\n",pop());
          return 0;
          }




Compiler output:
main.c: In function 'initialize':
main.c:8:18: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
    8 |        return top=0;
      |               ~~~^~
main.c:7:6: note: declared here
    7 | void initialize(){
      |      ^~~~~~~~~~
main.c: In function 'isempty':
main.c:12:18: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   12 |        return top==0;
      |               ~~~^~~
main.c:11:6: note: declared here
   11 | void isempty(){
      |      ^~~~~~~
main.c: In function 'isfull':
main.c:16:18: error: 'return' with a value, in function returning void [-Wreturn-mismatch]
   16 |        return top>=MAX-1;
      |               ~~~^~~~~~~
main.c:15:6: note: declared here
   15 | void isfull(){
      |      ^~~~~~
main.c: In function 'push':
main.c:20:12: error: void value not ignored as it ought to be
   20 |        if (isfull()){printf("overflow\n");exit(1);}
      |            ^~~~~~
main.c:20:43: error: implicit declaration of function 'exit' [-Wimplicit-function-declaration]
   20 |        if (isfull()){printf("overflow\n");exit(1);}
      |                                           ^~~~
main.c:2:1: note: include '<stdlib.h>' or provide a declaration of 'exit'
    1 | #include<stdio.h>
  +++ |+#include <stdlib.h>
    2 | #define MAX 1000
main.c:20:43: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   20 |        if (isfull()){printf("overflow\n");exit(1);}
      |                                           ^~~~
main.c:20:43: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c: In function 'pop':
main.c:27:12: error: void value not ignored as it ought to be
   27 |        if (isempty()){printf("overflow\n");exit(1);}
      |            ^~~~~~~
main.c:27:44: warning: incompatible implicit declaration of built-in function 'exit' [-Wbuiltin-declaration-mismatch]
   27 |        if (isempty()){printf("overflow\n");exit(1);}
      |                                            ^~~~
main.c:27:44: note: include '<stdlib.h>' or provide a declaration of 'exit'
main.c: In function 'main':
main.c:38:25: warning: comparison between pointer and integer
   38 |                    if(op=='+'){
      |                         ^~
main.c:44:30: warning: comparison between pointer and integer
   44 |                    else if(op=='-'){
      |                              ^~
main.c:50:30: warning: comparison between pointer and integer
   50 |                    else if(op=='*'){
      |                              ^~
main.c:56:31: error: implicit declaration of function 'atoi' [-Wimplicit-function-declaration]
   56 |                    else {push(atoi(op));}
      |                               ^~~~