When run, the following code seems to stop at cin.ignore(1000, '\n'); line, as "Enter some number" doesnt get printed.
Hitting carriage return causes the "Enter some number" line to display, and then the program works correctly in the following while loop iterations (meaning the "Enter some number: " gets displayed right away).
When cin.ignore(1000, '\n'); is called the first time there is nothing in the input buffer so it waits until there is something in the buffer (when you press carriage return) and then clears it. To fix it you would have to move around that line and change the loop slightly. Or a simple way is to use a boolean variable that skips the the 'cin.ignore' the first time round but not any time thereafter.
EDIT: Didn't realise someone just posted exactly what I said so I'll add onto this post. Placing the 'cin.clear()' line in the 'if' statement would make the condition in the loop false even though it did fail so you would need to use a boolean variable or some alternative.