pop double stack


#include <stdio.h>
#define MAXSIZE 100


int sp = 0;

double stack[MAXSIZE];


void push(double f)

{

if (sp < MAXSIZE)

stack[sp++] = f;

else

printf("error: stack is full\n");

}


double pop()

{

if (sp > 0)

return stack[--sp];

else

{

printf("error: stack is empty\n");

return 0;

}

}