Following is the function that are used to traverse the function from the top to bottom of the stack,
void traverse() { int i; printf("Stack is :n"); for(i=top;i>=0;i--){ printf("%d ",stack[i]); } }