https://ide.codingblocks.com/s/57878 there is some mistake in my code please debug
Stack using array
Hey Neeraj, error is in your code’s line:18 update it like this a[++top]=x; use ++top instead of top++ because you have initialized top with -1 in the constructor.