data structures/stack/c/stack_in_c.c
/*  Function to display the status of the stack */
Function to display the status of the stack
Function to display the status of the stack
void display ()
    {
        int i;
        if (s.top == -1)
        {
            printf ("Stack is empty\n");
            return;
        }
        else
        {
            printf ("\n The status of the stack is \n");
            for (i = s.top; i >= 0; i--)
            {
                printf ("%d\n", s.stk[i]);
            }
        }
        printf ("\n");
    }
void display ( ) { int i ; if ( s . top == -1 ) { printf ( " \n " ) ; return ; } else { printf ( " \n \n " ) ; for ( i = s . top ; i >= 0 ; i -- ) { printf ( " \n " , s . stk [ i ] ) ; } } printf ( " \n " ) ; }
Function to display the status of the stack
Function to display the status of the stack