Hi Folks,
For the users that have most recently posted in this topic. Welcome!
Everything that you output will be considered for the answer, so this will cause WA.
cout << "enter the numbers" << endl;
Please use code tags when posting code (see the nice box around the code above?)
I see all of you assuming that there will be a certain number of inputs. djs1234 assumes that it will be less than or equal to 20. This is not true. The problem states that you should continue to take input until it reads 42, it does not say if there will be 5, 100, 10000000 numbers in the input.
while not done
read input
if number = 42 then done
else print number
end while