diff --git a/Stack b/Stack deleted file mode 100644 index d9841ee..0000000 --- a/Stack +++ /dev/null @@ -1,83 +0,0 @@ - - -#include -int stack[100],top,n,option; -void push(); -void pop(); -void display(); -int main() -{ - top=-1; - printf("Enter the size of the stack :"); - scanf("%d",&n); - printf("1)push\n2)pop\n3)display\n4)exit"); - do{ - printf("Enter your choise :"); - scanf("%d",&option); - switch(option) - { - case 1: - push(); - break; - case 2: - pop(); - break; - case 3: - display(); - break; - case 4: - break; - default : - break; - - } - }while(option!=4); - - - - return 0; -} -void push() -{ - if(top>=n-1) - { - printf("Overflow\n"); - } - else - { - printf("Enter the element to push"); - top++; - scanf("%d",&stack[top]); - } -} -void pop() -{ - if(top<=-1) - { - printf("Underflow\n"); - } - else - { - - printf("the deleted element is %d",stack[top]); - top--; - - } -} -void display() -{ - if(top<=-1) - { - printf("epmty\n"); - } - else - { - - for(int i=top;i<=0;i--) - { - printf("%d",stack[i]); - } - - - } -}