Initially stack is empty = -1
stkFunc (-1, 10); this function
case -1: size = val; break; and static size= 10 // size memory declare one time only// and control comes out of switch b/c of break
stkFunc (0, 5); this function run
case 0: if (stkTop < size ) A[stkTop++]=val; break; here stktop is static value so memory declare at compile time only now check if condition 0< 10 true then A[stktop++== A[0+1]=val= 5 i.e. push 5 into stack break comes so control comes outside
stkFunc (0, 10); this comes
case 0: if (stkTop < size ) A[stkTop++]=val; break; same as above make A[stkTop++]= 10 i,e. push 10 into stack and break comes so control comes outside
printf ("%d\n", stkFunc(1, 0)+ stkFunc(1, 0));
this function
stkFunc(1, 0) this will run
default: if (stkTop) return A[--stkTop] return top of stack which is 10
stkFunc(1, 0) this will run
default: if (stkTop) return A[--stkTop] return top of stack which is 5
printf ("%d\n", stkFunc(1, 0)+ stkFunc(1, 0));= 5+10=15 15 will be printed