while(1) // here goes my problem, in this loop
cout<<"Enter an integer: ";
cout<<"Do you want to enter another integer? (Y/N) : ";
}while (choice=='Y' | choice=='y');
for (int i=ctr-1; i>=0;i--)
cout<<"\nSTACK is now empty!";
choice (line 12) is uninitialized.
If you execute the break at line 18, you will exit the inner loop and the while condition at line 28 will be evaluated against an uninitialized value, which is pretty much guaranteed to be false taking you back to the top of the loop.
When you entered a non-numeric, cin couldn't remove it from cin's buffer so it stayed there along with the newline. cin.clear resets cin's error flags. cin.ignore eats everything up to and including the newline so that cin's buffer is clear for the next input.