the size of stack was declared as ten thus stack


The size of stack was declared as ten. Thus, stack cannot hold more than ten elements. The major operations which can be performed onto a stack are push and pop. However, in a program, we have to provide two more options, namely, show elements & exit. Show elements will display the elements of the stack. In particular case, the user is not interested to carry out any operation onto the stack and would like to get out of the program, and then s/he will choose exit option. It will log the user out of the program. Choice is a variable that will enable the user to choose the option from the push, pop, show elements & exit operations. top points towards the index of the free location in the stack to where the next element can be pushed. Element is the variable that accepts the integer that need to be pushed onto the stack or will hold the top element of the stack which has to be popped from the stack. The array stack can hold at most ten elements. Push & pop will carry out the operations of pushing the element to the stack & popping the element from the stack respectively.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: the size of stack was declared as ten thus stack
Reference No:- TGS0263925

Expected delivery within 24 Hours