A stack is useful in writing recursive calls.
A stack is useful to convert in fix expression into post fix expression.
It can be used in function calls for example, suppose that function “a” calls function “b” and passes two variables ,”x” and “y” to “b”. Then the function “a” can store these two variables on the stack, from where the function “b” can retrieve and use them.
A stack can be used to evaluate the postfix expression.
A stack can be used to implement a calculator by storing the operands and the operators on the stack and using them as and when required.
The stack can be used in the algorithms which needs the back traversal.
Implementation of stack data structures using array
# include <studio.h>
#define maxsize 5
int stack [maxsize];
void insertion ()
if (Top== maxsize-1)
printf(“stack is over flow \n”);
printf(“Enter an element:”);
void deletion ()
printf(“Stack is under flow \n”);
printf(“ The deleted element is %d \n”, stack [Top]);
printf(“stack is under flow \n”);
printf(i=0; i<=Top; stack[i]);
printf(“Enter your choice:”);
case1: insertion (); break;
case2: deletion (); break;
case3: Display(); break;
After inserting i.e. entry 10, 20, 30, 40, 50.
Top max size
- 1 
stack is overflow
After deleting elements 50, 40, 30, 20, 10.
Stack is over flow
After deleting elements 50,40,30,20,10