Printing the stack

While printing the stack I used the following code:

If I use i<4 then it prints the whole stack

But if I use i<s.size() then it only prints 2 items

Why is it so?

hi @adityajan10th_a7b69a445a2459ca
kindly save the whole code on coding blocks ide (https://ide.codingblocks.com/) and send link… will check ur code…

Here is the link to the code

hi @adityajan10th_a7b69a445a2459ca
refer this -->

@adityajan10th_a7b69a445a2459ca
I hope it’s clear now??

Yes it’s clear,
Thanks

1 Like

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.