What is the output produced by the following program
// assume stack is implemented by default
a=stack()
for i in range(0,4):
a.push(i)
for j in range(0,4):
a.pop()
print(a.pop())
1
0
2
4
3
3
4
Underflow
What is the output produced by the following program
// assume stack is implemented by default
a=stack()
for i in range(0,4):
a.push(i)
for j in range(0,4):
a.pop()
print(a.pop())