0
Hey guys! I tried to write a menu driven STACK program but cannot get the desired output.
2 Antworten
+ 1
You need lot of changes..
1) You should declare prototypes before main(just after the header, macros declarations..).
2) you have infinite loop, so use input 0 to as stop condition or number above 9 like
while(choice! = 0)
Or whjle(choice >=1 && choice <= 9) {..}
3) you are displaying by using pop function which decrementing top by top-=1; every time so after every time insert element, again you emptying stack.. Use a alias variables for temparary values like n= top; then use n;
Hope it helps..
0
Thank you!