data structures/stack/c/stack_in_c.c
/*  Function to add an element to the stack */
Function to add an element to the stack
Function to add an element to the stack
void push ()
    {
        int num;
        if (s.top == (MAXSIZE - 1))
        {
            printf ("Stack is Full\n");
            return;
        }
        else
        {
            printf ("Enter the element to be pushed\n");
            scanf ("%d", &num);
            s.top = s.top + 1;
            s.stk[s.top] = num;
        }
        return;
    }
void push ( ) { int num ; if ( s . top == ( MAXSIZE - 1 ) ) { printf ( " \n " ) ; return ; } else { printf ( " \n " ) ; scanf ( " " , & num ) ; s . top = s . top + 1 ; s . stk [ s . top ] = num ; } return ; }
Function to add an element to the stack
Function to add an element to the stack