[SOLVED] (Thank you) Removed - sololearn C# challenge
I'm attempting to complete this challenge and I'm close, but for some reason it seems to be outputting an additional number (sometimes two additional numbers) that i cant account for. the challenge reads like this: "The program you are given defines the evenNums stack and pushes 3 even numbers (6, 8 and 4) onto it. The 4th number is taken from the user and also pushed. But we need to check whether it is also an even number. Complete the program to perform that check process, and if the last pushed number N isn't even, remove it from stack and output "N: Removed" (see sample output). At the end, output all the elements of the stack, separated by spaces. Sample Input 1 Sample Output Checking the last number: 1 1: Removed 6 8 4 Pop() - Returns the element at the top of the stack and removes it. The output should end with a space." my code is here: https://code.sololearn.com/cA22A1a0A14A can anyone explain why im getting that extra number(s), and offer a solution for getting rid please? thank you.