Here is a link to the code:
http://cpp.sh/2hz5
Basicly, instead of parsing the input right into the
double number
variable, which can act weird if the user inputs something that cant be converted into double, read it into a string, and then use
std:stod(string)
to convert it.
From what I understood, it should throw an exception and end the program if the input is invalid.
I also fixed your code for reading and verifying the input, removed the break statement that would allow invalid input on the second try, and added a line on the yes check, to reset the value of number to -1.
I would advise implementing it without the goto as the others have said. Its not a good idea. On this small program it works, but it can become a mess real quick when the size of the solution increases.
Hope it helps!