Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
stack
#include <stdio.h> #define max 4 int stack_arr[max]; int top= -1; void push(int data) { if(top == max-1) { printf("stack overflow"); return; } top=top+1; stack_arr[top]= data; printf("%d \t",stack_arr[top]); } int pop() { int value; if(top == -1) { printf("stack underflow"); } value=stack_arr[top]; top= top-1; return value; } int main() { int data; push(7); push(11); push(20); data= pop(); printf("\npoped element:%d\n",data); while(top!=-1) { printf("%d \t",stack_arr[top]); top--; } }
run
|
edit
|
history
|
help
0
Default_Template
Fractional Knapsack
Sorting sort function stl in c++
TwoANOVA
FindMissingBinom
multi bitmap
my template
Microsoft - # of fragments (optimised)
O
Text Justification